Mr Davies returned to the UK on Saturday (photo courtesy of Fair Trials Abroad)

Alan John Davies, 65, from Blackpool, Lancashire, was convicted of trying to sell a large amount of heroin to a police informer in Thailand.

Mr Davies was sentenced to death after a trial in September 1994, a term later reduced to 25 years in jail.

Fair Trials Abroad say he was the victim of a "miscarriage of justice".

Mr Davies, who previously lived in Poole, Dorset, arrived back at Heathrow on Saturday after being released from a Bangkok prison on 8 May.

He said: "It's more of a relief than anything. At last I'm away from there.

"That part of my life is over. When it happened I never thought it would go on this long."

"I'm happy and gradually getting round to seeing and speaking to all my friends who helped me."

We believe his case is a miscarriage of justice

Catherine Wolthuizen, Fair Trials Abroad

Catherine Wolthuizen, chief executive of Fair Trials Abroad, said Mr Davies was the longest-serving British prisoner overseas.

"He was in prison for 17 years," said Ms Wolthuizen.

"There were a number of very severe anomalies in John's arrest and subsequent trial.

"There were severe problems in how his applications for pardons were handled and also what we conceived to be very worrying irregularities in evidence and documentation provided by an official attached to the British Embassy.

Death row

"We believe his case is a miscarriage of justice. Lawyers working on his case wrote on his behalf attesting to that."

The Foreign and Commonwealth Office (FCO) said its staff had done all they could to help Mr Davies.

"Since his arrest and detention in 1990 consular staff have visited Mr Davies in prison on a regular basis," a spokeswoman said.

"Consular staff have provided a welfare role. We supported two appeals for clemency on the grounds of Mr Davies' ill health."

The spokeswoman added that the FCO could not interfere or become involved in another country's judicial process.

Mr Davies left Blackpool in January 1988 and was living in Thailand and working for a firm organising work contracts when he was implicated in a drug supply plot.

He was shackled with heavy leg irons for two years while on death row in the high-security Bangkwang prison in Nonthaburi.

'Hell-hole'

Mr Davies was later transferred to Klong Prem prison in Bangkok and said his wife died while he was in jail.

Describing the conditions he said: "It was a hell-hole. You understand that 10% of the prison population die every year - about 5,000 prisoners."

Mr Davies survived a stroke in prison and an infection which almost led to his foot being amputated.

"I survived because a lot of people helped me from the UK," he added.

"That is what kept me going. If you are on your own there you get depressed, some take drugs, you have to cope."

Mr Davies will mark his 66th birthday on Thursday and was planning to spend time with friends on Saturday.