The British grandfather who was facing 350 lashes in Saudi Arabia will be released within a week, the Foreign Secretary has said.
Karl Andree was facing the punishment after being caught with homemade wine in his car, breaching the country's ban on alcohol.
Philip Hammond confirmed the release of the 74-year-old during a visit to the country where he met the Saudi king.
"I'm pleased to be able to say I have heard this morning that the public prosecutor is in the final stages of completing the necessary processes that will lead to Mr Andree's release and return to the UK, we expect, within the next week," he said.
Mr. Andree was sentenced to 12 months in jail by a Sharia court last year - a sentence he has served.
His family were worried the public flogging could kill him as he suffers from asthma and is frail after surviving cancer three times.
His son Simon told Sky News he was "extremely, extremely happy" that his father would finally be coming home.
He said the family's decision to seek publicity "because nothing was being done" had proved to be the right move.
"It was never about causing offence (to Saudi Arabia) - we just wanted our father back because he had served his time," Mr Andree said.
"My father wanted to serve his time. He was guilty of something he shouldn't have done. But he had served his time and we were concerned nothing was happening."
Simon Andree urged anyone in a similar situation to "have faith, don't give up".
Despite living in the country for 25 years, Mr Andree said he hoped his father would now return to the UK for good.
He told Sky News: "We are hoping when he comes back he will stay but obviously it's his life ... I don't think he's intending returning to Saudi ... we will be having very strong words with him."
Three of Mr Andree's grandchildren had last week made an emotional video appealing for David Cameron to intervene in the case.
"No human deserves to be treated like this," said the message. "He is really poorly, really old and we love him very much."
"Please Mr Cameron, don't forget our grandad, you're his only hope," they added.
An online petition calling for his release has also attracted more than 255,000 names.
Mr Andree's case has added to strained diplomatic relations of late between the UK and Saudi Arabia.
The Government withdrew from bidding for a contract with the Saudi justice system - but denied it was in protest over his case.
The country's ambassador to Britain then warned of "potentially serious repercussions" and a lack of "mutual respect" over the way his country was being discussed.