Former Maldives president Mohamed Nasheed was sentenced to 13 years in prison on Friday after being found guilty of terrorism for ordering the arrest of a judge when he was in power in 2012.
The verdict is the latest chapter in three turbulent years in which Nasheed, the Indian Ocean archipelago's first democratically elected leader, was ousted in disputed circumstances, then narrowly defeated in a controversial election, and then, last month, cleared over the incident for which he has now been convicted.
"The prosecution's evidence proved beyond reasonable doubt that Nasheed ordered the chief judge's arrest or forceful abduction and detention on Girifushi island," Judge Abdulla Didi said in the court in the capital, Male.
The three-judge bench's verdict was unanimous, and the office of President Abdulla Yameen, who had denied that the prosecution was political, confirmed the 13-year sentence.
Nasheed's election in 2008 ended the autocratic 30-year rule of Yameen's half-brother, Maumoon Abdul Gayoom.
The announcement last month that Nasheed had been arrested on terrorism charges brought thousands onto the streets of the capital Male, leading to clashes with security forces.
Countries including India and the United States have expressed concern about Nasheed's treatment and trial.
The US state department said in a statement on Friday it was "particularly troubled by reports that the trial was conducted in a manner contrary to Maldivian law and Maldives' international obligations."
Tensions had been rising again as the verdict approached and hundreds of Nasheed's supporters, some waving "Free Nasheed" posters, had gathered outside the courtroom on Friday night.
Police said they had briefly detained 13 men close to the courtroom.
A Reuters witness outside the court said the crowds had dispersed after the sentencing.
In a statement in court, Nasheed urged his supporters to come out onto the streets in protest, according to a text released by his office.
"I appeal to all of you today to stay courageous and strong, to confront the dictatorial power of this regime, to change this government and work towards forming a government that would pave the way for the people's development and prosperity," he said, according to the text, released after his sentencing.
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.
The prosecutor-general last month withdrew criminal charges that had been brought against Nasheed over the judge's arrest, only to issue an arrest warrant shortly afterwards on new charges of terrorism relating to the same incident, bringing thousands out onto the streets in protest.
The Maldives is a string of more than 1,100 coral islands popular as a holiday paradise.