The Maldives' Supreme Court on Monday canceled a 13-year jail sentence imposed on former president Mohamed Nasheed for a terrorism conviction, saying prosecutors had provided no evidence to prove his guilt.
Nasheed, the country's first democratically elected leader, was wrongfully charged and the criminal court should not have proceeded to trial, the court said.
Under former leader Abdulla Yameen's administration, which jailed a number of opposition leaders on various charges, the Supreme Court had previously upheld the conviction in 2016.
Yameen lost power in the September presidential election to Nasheed's ally Ibrahim Mohamed Solih.
Nasheed was found guilty of ordering the military to arrest and detain the Maldives' criminal court's chief judge in January 2012. He was convicted under terrorism charges in 2015 but the next year was allowed to go to Britain for medical treatment.
He was granted political asylum in Britain and lived there and in Sri Lanka during his three years in exile, during which he worked to garner international support for the opposition and to form the joint-opposition coalition which won the 2018 presidential election.
In Monday's ruling, the court said that Nasheed's terrorism conviction was based on false procedure as prosecutors had not submitted any evidence to prove his guilt.
"As the charges against Nasheed was brought without due process, any process that occurred under those charges are null and void," Chief Justice Ahmed Abdulla Didi said.
He was greeted by jubilant supporters when he emerged from the court building after the judgment was delivered.
"Especially today, I do not believe that my political career is over," Nasheed said as supporters cheered his release.
The arrest of the judge in 2012 triggered a crisis in which Nasheed has said he was forced to resign at gunpoint. His allies say he was ousted in a coup.
Yameen then became president in November 2013 in an election whose second-round runoff was cancelled when early results put Nasheed ahead. When the second round was re-run, Nasheed lost by a narrow margin and conceded defeat.
Nasheed has been critical of the Yameen administration's heavy Chinese debts and has promised to renegotiate all the Chinese projects. He was not allowed to contest the September election.