Malaysia's opposition leader Anwar Ibrahim has been acquitted by the country's High Court of a sex offence against a former aide, citing unreliable DNA evidence.
The verdict surprised supporters who saw the case as an attempt to sideline him.
Mr Anwar has long maintained that prime minister Najib Razak's ruling coalition concocted the sodomy charge to damage his chances of leading the opposition to an election victory.
Mr Najib, who is expected to call for national elections some time this year, denies plotting against Mr Anwar.
His administration said the judgment showed that Malaysia's legal system is free from government interference, despite claims to the contrary by opposition activists.
The case rested mainly on evidence by Mr Anwar's 26-year-old accuser, Saiful Bukhari Azlan, and DNA samples found on Mr Saiful's body that investigators said matched Mr Anwar's.
But High Court judge Mohamad Zabidin Diah said his decision was founded on concerns that the DNA evidence was tainted.
"The court at this stage could not with 100% certainty exclude the possibility that the (DNA) sample is not compromised," he told the court. "Therefore it is not safe to rely on the (DNA) sample. There is no evidence to corroborate" the charge.
A crowd of Mr Anwar's supporters shouted "Allahu Akbar", or "God is great", after the judge finished reading the verdict. Members of his family burst into tears and hugged him.
"Thank God justice has prevailed," a jubilant Mr Anwar said following the ruling. "I have been vindicated. To be honest, I am a little surprised."