Former Maldivian President Mohamed Nasheed has said that he was forced to resign "at gunpoint" by police and army officers in a coup.
He said the move was planned with the knowledge of Vice-President Mohammed Waheed Hassan Manik, who has replaced him. Mr Hassan denies the claims.
Dozens of demonstrators - including Mr Nasheed - were injured as riot police used tear gas and batons against protesters in Republic Square.
Mr Nasheed quit on Tuesday amid unrest.
He announced his resignation after police joined opposition-led protests over the detention of a top judge.
Several thousand Maldivian Democratic Party (MDP) supporters, led by Mr Nasheed, marched through the streets of the capital earlier on Wednesday in protest at his ousting.
Acting police commissioner Abdulla Fairooz said "around 40" people have been arrested in the protests, including former MDP chairperson Mariya Ahmed Didi.
The BBC's Andrew North, in Male, says soldiers in riot gear and police with batons charged the crowd and fired tear gas. The main square is now blocked off by soldiers and police.
Those detained include one of the former president's senior officials, our correspondent says. Other reports say MDP supporters threw petrol bombs at police and demanded Mr Nasheed be reinstated.
The head of the youth wing for the former ruling MDP, Shauna Aminath, said she was part of a crowd of protesters near Republic Square when riot police charged at them.
"The police here are animals. It was peaceful.. and then the police came straight at us. So many people have been injured," she told the BBC.
Mohamed Afaal, managing director at ADK hospital in Male, told the BBC that 14 people had been treated for injuries sustained due to the protests, none critically. Others wounded in the demonstrations have been taken to the main IGMH hospital.
Military spokesman Ibrahim Azim confirmed Mr Nasheed had "received some small injuries because the crowds were huge and he has been taken to hospital". His family have said he is now safely at home.
Meanwhile, residents and a police official said MDP demonstrators had seized some police stations on small islands outside of the capital.
'Guns all around me'
Mr Nasheed's whereabouts over the past 24 hours have been unclear at times and his aides have alleged he was being held against his will.
But on Wednesday, the Maldives first democratically elected president met party supporters and told them he would fight to get his job back. He urged Mr Hassan to stand down and called for immediate elections.
"Yes, I was forced to resign at gunpoint," he told reporters after the meeting. "There were guns all around me and they told me they wouldn't hesitate to use them if I didn't resign."
He told the AFP news agency in a telephone interview that he had gone to military headquarters on Tuesday where he found about 18 "middle-ranking" police and army officers in control.
"I wanted to negotiate the lives of the people who were serving in my government."
He added that he feared Mr Hassan - formerly his vice-president - was "in on" their plans.
The new president in turn criticised Mr Nasheed for wrongfully arresting Justice Abdulla Mohamed last month.
He denies a coup took place or that there was a pre-arranged plan for him to stage a takeover. Mr Hassan said his aim now was to form a coalition to help build a stable and democratic country ahead of fresh presidential elections due next year.
"We will respect the rule of law, we will uphold the constitution, the executive will not interfere in legislation and we will make sure that democracy is consolidated," he told a news conference on Wednesday.
He also promised to protect Mr Nasheed from retribution, pointing out that he was free to leave the country.
However he said he would not interfere with any police or court action against Mr Nasheed.
The authorities are reported to be investigating the discovery of bottles of alcohol at Mr Nasheed's former residence. Consuming alcohol outside tourist resorts is a crime in the Muslim nation.
Protests over the arrest of Justice Mohamed are widely seen has having hastened the downfall of Mr Nasheed, who critics say acted unconstitutionally.
The judge was released soon after Mr Hassan took power.
The judge was accused of being loyal to the opposition by ordering the release of a government critic he said had been illegally detained.
Hours before Mr Nasheed's resignation, there had been a mutiny in police ranks which saw a few dozen officers side with protesters and then clash with soldiers in the streets.
The mutinying officers took control of the state broadcaster in the capital, Male, and began playing out messages in support of former president Maumoon Abdul Gayoom, an autocrat who ruled for more than 30 years.
Mr Nasheed, a former political prisoner, defeated him in the country's first multi-party elections in 2008.
British, US and Australian diplomats have flown in from neighbouring Sri Lanka to provide consular assistance, if needed, to tourists holidaying in the Maldives.
Foreign governments are advising those visiting the islands to be careful. The archipelago receives nearly a million visitors a year - but most head straight to their resorts and never reach the capital.