Malaysian former Deputy Prime Minister Anwar Ibrahim has been set free from jail after the country's highest court overturned his sodomy conviction.
Anwar Ibrahim has been in jail for nearly six years
The decision came six years to the day after his mentor-turned-rival, former leader Mahathir Mohammed, sacked him following a row over the economy.
Mr Anwar has always argued that charges against him were politically motivated.
He told the BBC he would now travel to Germany for treatment for back problems he says resulted from a police beating.
As news of his release filtered out of the court, a roar went up from supporters outside.
ANWAR'S LEGAL BATTLE
Sept 98 - Sacked and arrested
April 99 - Jailed for six years for corruption relating to alleged sodomy
July 00 - Sentenced to further nine years for sodomy - alleged to have had sex with five men
July 2002 - Loses appeal against corruption conviction
Sept 2004 - Wins appeal against sodomy conviction
Mr Anwar, looking frail, sat impassive in a wheelchair in the dock, but when faced with his jubilant supporters, who held him aloft on their shoulders, he was overcome with emotion.
"Thank God, after six years I am now free," he told the BBC.
His original trials had been widely condemned as flawed and Malaysia's federal court accepted that his sodomy conviction was unsafe.
The court was reviewing an earlier rejection of Mr Anwar's appeal - but decided to quash the original conviction by a vote of 2-1.
"We allow the sentence and conviction to be set aside. We find the High Court misdirected itself. He should have been acquitted," said Judge Abdul Hamid Mohamad, head of a three-judge panel.
In reviewing the evidence, the court decided the prosecution's key witness was unreliable and in effect an accomplice.
Azizan Abubakar alleged he had been sodomised by Mr Anwar in May 1994.
The date was later amended to May 1992, but when it emerged that the condominium where the alleged act supposedly took place did not then exist, the charge was amended a second time.
The court also concluded that Mr Anwar's co-accused did not appear to have confessed voluntarily, and expressed concern that the police had been heavy-handed.
Mr Anwar's supporters say he was charged for politically motivates
The judges therefore concluded that Mr Anwar should have been acquitted without having to enter a defence as the prosecution had not managed to prove the case beyond reasonable doubt.
Mr Anwar was sacked from his post as deputy in 1998 following a rift with Dr Mahathir over how to run the country's economy.
Mr Anwar responded by leading a massive anti-government protest. That evening police broke down his door and arrested him.
In 1999 he was jailed for six years for corruption, and in 2000 he received a further nine years for sodomy.
Mr Anwar had already failed to reverse the first of those convictions and finished serving his sentence for corruption last year.
Thursday's appeal to Malaysia's highest court over the second sentence was the last legal opening for the former minister.
The BBC correspondent in Kuala Lumpur, Jonathan Kent, says Mr Anwar's continued imprisonment had posed problems for the government of current Prime Minister Abdullah Badawi, who succeeded Dr Mahathir in November.
"You've got to recognise the fact that his predecessor wouldn't have made this judgment possible," Mr Anwar told reporters on Thursday.