Former Maldives President Mohamed Nasheed was sentenced to 13 years in prison Friday for ordering a senior judge arrested in January 2012 while in office. A three-judge panel unanimously found him guilty and sentenced him under the country’s anti-terrorism laws following 10 hearings over 23 days.

"Nasheed is found guilty of arresting and illegally detaining Judge Abdulla Mohamed," Judge Abdulla Didi told the court in a verdict just before midnight, according to Al Jazeera. Nasheed was then taken to Dhoonidhoo prison, near the capital Malé.

Nasheed had denied ordering the arrest, and his supporters said the charges were aimed at eliminating him as a challenger against incumbent President Abdulla Yameen Abdul Gayoom in the 2018 presidential elections, according to the Associated Press. Gayoom has denied that the trial was politically motivated, according to the BBC.

The former leader was originally charged with abuse of power but was cleared last month. A few days later, the prosecutor general had him re-charged and arrested for terrorism. The court had said that the anti-terrorism law not only covered violent terrorism, but also a wide array of actions against the state, which Nasheed’s call for the arrest of Mohamed fell under, according to Al Jazeera. According to the prosecution, Nasheed had unlawfully used the military to conduct the arrest after the judge released a detained opposition politician.

Nasheed was the country’s first democratically elected president when he rose to power in 2008 after winning the first multi-party presidential elections. He defeated the previous leader, Maumoon Abdul Gayoom -- the incumbent president’s half-brother -- who had autocratically ruled Maldives for 30 years. Nasheed resigned in 2012 under claims of a coup d’état.

Both the United States and India have voiced concerns over the sentencing, and hundreds of supporters have been protesting Nasheed’s arrest. Hamid Abdul Gafoor, a spokesman for Nasheed's Maldivian Democratic Party, called the verdict a "travesty of justice," according to AP.