Maldives President Mohamed Nasheed has stepped down after weeks of demonstrations and a mutiny by some police officers.
In an address on state TV, Mohamed Nasheed said it would be “better for the country in the current situation” if he stood down.
Vice-President Waheed Hassan has been sworn in as president after Mohamed Nasheed stepped down.
Tensions escalated after the Maldives army arrested a senior judge last month, prompting bitter street protests in the Indian Ocean island chain.
A source close to the president described Tuesday’s developments as a “coup by the former regime”.
But the army and the vice-president have denied a coup has taken place.
Waheed Hassan’s office denied widespread reports the military pressured Mohamed Nasheed to resign, the AP news agency reports.
“It was not a coup at all, it was the wish of the people,” said Ahmed Thoufeeg, Waheed Hassan’s secretary.
Mohamed Nasheed announced his resignation during a televised news conference.
“It will be better for the country in the current situation if I resign. I don’t want to run the country with an iron fist. I am resigning,” Mohamed Nasheed said.
Earlier, a group of mutinying police officers took control of the state broadcaster in the capital, Male, and began playing out messages in support of former President Maumoon Abdul Gayoom.
Several journalists were said to be detained in the facility.
Sources in the office of Mohamed Nasheed said Tuesday’s protest took place in front of military headquarters, a high-security zone.
Soldiers used tear gas to break up a demonstration by supporters of Maumoon Abdul Gayoom.
On Monday, around 50 policemen stood down in favour of the protesters and refused to obey orders.
The president’s office denied reports that the army fired rubber bullets at the protesting police officers.
Last month the army arrested a senior criminal court judge, Judge Abdulla Mohamed.
The government alleged that the judge’s rulings – such as the release of an opposition activist detained without a warrant – were politically motivated.
It claimed the dispute with the judge was not an isolated incident, but indicative of a more deep-rooted problem with the Maldives judicial system and the checks and balances it has to ensure it stays independent.
Human rights groups added their voices to calls for the judge to be released – and, as matters grew increasingly heated, there were demands for the United Nations to be brought in to resolve the dispute.
Mohamed Nasheed was elected in 2008, in the first multi-party poll.
Since then, correspondents say, the country has been gripped by constitutional gridlock – because parties opposed to the president dominate parliament.
Mohamed Nasheed, a former human rights campaigner, beat long-time ruler Maumoon Abdul Gayoom, who had been in power for 30 years and was widely seen as autocratic, in the country’s first multiparty election.
A one-time political prisoner, Mohamed Nasheed became a vocal figure in office on issues relating to the environment and climate change.
That pressure has intensified with the prospect of fresh elections, scheduled for next year. Opposition parties are jockeying for power as they try to extend their influence.
The wider question is how this crisis will affect the forthcoming elections – and what it says about the transition in the Maldives to mature democracy.