He said the move was planned with the knowledge of vice president Mohammed Waheed Hassan who has replaced him.

Mr Nasheed resigned after some security officials joined opposition protests over the removal of a top judge.

Mr Hassan denies a coup took place or that there was a pre-arranged plan for him to stage a takeover.

Hundreds of Maldivian Democratic Party (MDP) supporters, led by Mr Nasheed, have marched through the streets of Male in protest at his ousting.

The BBC’s Andrew North, in Male, says there were angry scuffles with a few police, but for the most part the security forces were conspicuous by their absence.

Our correspondent says the streets are otherwise calm and life appears to be quickly returning to normal after clashes and protests earlier in the week.

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.

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.