The Maldives first freely elected president resigned Tuesday after what his party called a "coup d'etat" orchestrated by opposition leaders with the backing of security forces in the holiday paradise.
"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," President Mohamed Nasheed told a televised news conference.
His announcement followed a police mutiny that capped three weeks of anti-government demonstrations in the Indian Ocean island nation against what activists saw as Nasheed's "unconstitutional" arrest of a senior judge.
In a series of statements released publicly and to foreign diplomatic missions, Nasheed's Maldives Democratic Party (MDP) said the president's resignation was "involuntary" and that he had been effectively overthrown.
"We strongly condemn the coup d'etat that has been brought against the constitutionally elected government," the party said.
It said the president had been taken to his office "under the custody of the security forces" and forced to announce he was stepping down.
A few hours later, Vice President Mohamed Waheed, who belongs to a different political party and had clashed with Nasheed over the chief justice's detention, was sworn in as the new head of state.
Promising to uphold the "rule of law", Waheed urged the population of 300,000 Sunni Muslims to remain calm and said no acts of "revenge" should be taken against members of Nasheed's government.
Following the announcement Nasheed spent the afternoon in his official residence before being escorted to a family home by armed guards where he spent the evening, his brother Nazim Sattar said.
The dramatic day of unrest began in the early hours when a group of policemen -- estimated at from several dozen to several hundred strong -- refused orders to break up an anti-government protest in the capital Male.
The MDP said members of the armed forces had joined the protesters' ranks at the behest of senior opposition leaders loyal to former president Maumoon Abdul Gayoom.
Gayoom, who had ruled the Maldives for 30 years, was ousted by Nasheed in the country's first democratic elections in 2008.
"The opposition, supported by the army and police, offered an ultimatum to President Nasheed: Step down or be faced with a bloodbath in the capital," the MDP said.
"These police and army personnel ignoring the chain of command, moved around the capital in full riot gear, attacking MDP headquarters," it added.
Army spokesman Colonel Abdul Raheem Abdul Latheef categorically denied that any coup had taken place, saying that Nasheed had sought the army's advice and was told that resignation was probably the best option.
It was a spectacular fall for Nasheed, a 44-year-old media-savvy father of two daughters, who rose to power from grassroots political opposition to the autocratic Gayoom regime which imprisoned him on several occasions.
He formed the MDP in exile before returning home to a hero's welcome, sweeping 54 percent of the vote in the 2008 polls.
He used his mandate to build a reputation internationally as a committed campaigner against climate change and once held a cabinet meeting underwater to highlight the dangers of rising sea levels.
But protests calling for his resignation escalated after he ordered the arrest last month of Criminal Court Chief Justice Abdulla Mohamed on charges of misconduct and favouring opposition figures.
The unrest had also seen demonstrations by Islamic fundamentalists against the government, particularly over the transport ministry's decision to allow direct flights from Israel.
Large crowds gathered outside the president's office after his resignation announcement, but residents said the streets had largely cleared by evening.
Police spokesman Ahmed Shiyam told AFP by telephone that "anyone from the previous regime who worked against the constitution and laws" would not be allowed to leave the country.
The Maldives, a nation of almost 1,200 islands scattered across the equator, is dependent on tourism and is famous for its upmarket holiday resorts and hotels that cater to honeymooning couples and high-end travellers.
Travel agencies said there were already signs the instability was putting off tourists, who are a vital source of revenue.
The British government advised against all but essential travel to the capital Male.
Regional power India, which intervened with troops to prevent a coup in the Maldives in 1988, said the resignation was "an internal matter", adding that it hoped "all issues will be resolved in a peaceful and democratic manner".