A former president of the Maldives was convicted and sentenced to 13 years in prison after a quick and disputed trial for allegedly ordering a senior judge arrested while in office.

A three-judge panel ruled Friday that Mohamed Nasheed, the country's first democratically elected president, issued an illegal order to detain the judge in 2012.

Nasheed has denied ordering the arrest. His supporters say the charges are aimed at eliminating him as a challenger against incumbent President Yameen Abdul Gayoom in the 2018 presidential election.

Nasheed's lawyers pulled out in the middle of the trial, accusing the court of rushing the hearings and not allowing them enough time to prepare for defense.

Maldives is an Indian Ocean archipelago nation known for its luxury resort islands.