A few hours before, Mr. Yameen, who had already begun getting a reputation as an autocrat, declared a state of emergency, suspending several constitutional rights and giving himself sweeping powers to arrest and detain.
By Tuesday evening, it wasn’t clear what Mr. Yameen, a close ally of Saudi Arabia and China, was going to do next. Several Western governments criticized his crackdown. India said it was “disturbed” by the developments.
“We are on a path to completely destroying the democracy,” said Ahmed Tholal, a program coordinator at Transparency Maldives, an anti-corruption group. “Last night was more like a military takeover.”
It’s not the first time in recent years that the small nation has seen political upheaval. Former President Mohamed Nasheed, who has become an international celebrity because of his work to combat climate change, was the country’s first and only democratically elected leader.
But Mr. Nasheed was ousted in a 2012 coup and later jailed. He is now in exile in Sri Lanka, and has been offered asylum in Britain. He has called on the United States and India to intervene in the recent political crackdown.
The bad blood between Mr. Yameen and the political opposition goes back years. In recent months, Mr. Yameen even turned on his half brother, former President Maumoon Abdul Gayoom, who was led out of his house on Tuesday morning and was soon in jail.
By Tuesday evening, the capital, Malé, was calm, with shops open and traffic circulating, but fear hung in the air.
Supreme Court bends to presidential pressure
Mr. Yameen has incarcerated many of his political opponents, but last week the Supreme Court said that several of those convictions were invalid and ordered top political prisoners should be released.
Instead of complying with the court order, Mr. Yameen’s security forces began arresting more people. The tactics bore all the hallmarks of a totalitarian purge.
A career politician, Mr. Yameen, 58, is not especially popular.
He is widely suspected of siphoning millions of dollars from secret deals in which the Maldives sold islands to foreign companies that will one day turn the coral specks into high-end tourist resorts. The Maldives is already among the most exclusive and expensive vacation spots in the world, with many resorts charging upward of $2,000 per night.
What complicates the picture is that the Supreme Court and several of the opposition figures are suspected of graft as well.
Many Maldivians believe the court has been bribed by wealthy opposition figures to rule against the president — something Mr. Yameen kept referring to in his televised remarks on Tuesday. He said the judges had been planning a coup.
On Tuesday night, the three judges who were not arrested took an action favorable to Mr. Yameen: They nullified parts of the original order, saying the political prisoners should not be released and the convictions should stand. It was widely suspected that the judges had felt pressured to do this.
Human rights groups urged Mr. Yameen not to take the law into his own hands.
“The world’s eyes are on the Maldives right now,” said Biraj Patnaik, Amnesty International’s South Asia director. “A state of emergency cannot be used to carry out what appears to be a purge of the Supreme Court and the opposition.”