The Maldives top court overturned a terrorism conviction on Monday against the country's first democratically elected leader Mohamed Nasheed, who fled into exile after being sentenced to 13 years behind bars.
The Supreme Court said Nasheed was wrongfully charged and should not have been convicted in the 2015 trial described by the United Nations as politically motivated.
Nasheed went into exile a year later while abroad seeking medical treatment, and was branded a fugitive from justice.
"President Nasheed's entire trial was a politically-motivated sham," his lawyer, Hisaan Hussein, said after his conviction was quashed.
"It is appalling that an innocent man was unjustly forced to spend a year in jail, 35 months in exile, and was prevented from standing for political office."
The opposition icon only returned to the Maldives this month after his political rival Abdulla Yameen, who ruled the Maldives with an iron fist for five years, was beaten in a presidential election.
The strongman president jailed or exiled most of his opponents but since he departed office political prisoners have been freed and opponents abroad have returned.
Nasheed, the leader of the opposition Maldivian Democratic Party, was expected to contest the September poll but was barred on account of his terrorism conviction.
His party's nominee, Ibrahim Mohamed Solih, ran and unexpectedly defeated Yameen despite curbs on opposition campaigning.
Nasheed risked arrest if he ever returned to the Maldives while Yameen remained in power.
Nasheed was elected president in the Maldives first-ever democratic poll in 2008, ousting an authoritarian president who had ruled the honeymoon islands for 30 years.
But he was toppled in what he called a coup in 2012, and found guilty of terrorism three years later.
His appeal against his 13-year jail sentence had languished before the courts for years before Yameen's defeat and the case reopened.