A British man acquitted of bribery by an Afghan appeal court has described time in prison as "a living hell".
Bill Shaw, a 52-year-old former Army officer from Leeds, was found guilty of bribing officials in March.
At the time, he was manager of a security firm providing protection to foreigners. He said he thought he paid a legitimate fine.
Mr Shaw told the BBC he was looking forward to "proper freedom". His family said they were "absolutely elated".
The appeal court cited lack of evidence as the reason for dropping the charges.
At his trial at Afghanistan's newly-established anti-corruption court in March, Mr Shaw admitted paying for the release of two impounded vehicles but insisted he thought it was a fine.
He was jailed for two years and fined £16,185.
Afghan officials who took the money have since disappeared.
Mr Shaw, who served for 28 years in the British army and was awarded the MBE for his service, was held in Kabul's Pul-e-Charkhi prison, alongside inmates from the Taliban and al-Qaeda.
He told the BBC he was "very, very excited" he had been cleared, but the last four months had been "in all honesty, a living hell".
"I never thought, as an honest person with integrity, that I'd be put in this position.
"That's why I never ran away in the first place, even though advised to. But I didn't because I stood, and I've got principles.
"And I'm just looking forward now to proper freedom now and taking these chains off," he said.
Mr Shaw's daughter Lisa Lucklyn-Malone, who lives in Kent, said the family was "over the moon" and her father "deserved" to be released.
"He called from the court room, choking back emotion, he was finding it hard to speak, but said 'I'm coming home, I'm free, it's brilliant'.
"We've been sure of dad's innocence all along and we are truly grateful to the appeal court for its decision," she said.
She went on to thank people "all over the world" for their "incredible support".
She said her father had lost a lot of weight, and was physcially and mentally drained, but the news would have "picked him up 100%".
The BBC's Quentin Sommerville in Kabul, said Mr Shaw told him it was "unbelievable".
"He's clearly in shock, he didn't really know whether these charges were going to be dropped against him or whether the appeal would be successful," he said.
Our correspondent said Mr Shaw was likely to be released within a week.
But he added the "positively medieval" and "very dangerous" prison that Mr Shaw had been held in had taken its toll.
A Foreign Office spokeswoman said she was "pleased" for Mr Shaw and his family and consular staff were liaising with officials in Kabul to determine a date for his return to the UK.
"We welcome the appeal court's decision which is now subject to finalisation in the Supreme Court.
"The UK continues to strongly support the work of the Afghan government to counter corruption and reinforce the rule of law in Afghanistan," she said.
At the appeal ruling, Mr Shaw's co-defendant, Afghan bodyguard and translator Maiwand Limar, had his sentence downgraded from two years to eight months.