Police in the Maldives have dragged the country's former president into a court, which ordered his detention throughout his trial over a decision to arrest a senior judge three years ago.

Mohamed Nasheed was arrested Sunday and charged under an anti-terrorism law.

He was brought to Criminal Court on Monday for the first hearing, and was dragged into the courtroom after he resisted police attempts to stop him from speaking to journalists gathered outside.

The three-judge panel gave Nasheed three days to name his lawyers.

The Maldives government says the anti-terrorism law covers not only violent terrorism, but a wide array of actions against the state.

Nasheed resigned as president in 2012 following weeks of public protests against his order to arrest the top Criminal Court judge.