The Maldives government has declared a 15-day state of emergency as the political crisis deepened over a stand-off between the president and the supreme court in the Indian Ocean nation.

A surprise supreme court ruling last week ordering the release of imprisoned opposition leaders has led to growing turmoil, with the president lashing out at the court, opposition protests spilling into the streets of the capital, Male, and soldiers in riot gear deployed to the parliament building to stop MPs from entering.

The extent of the emergency order is not immediately clear.

President Yameen Abdul Gayoom said on state television: “During this time, though certain rights will be restricted, general movements, services and businesses will not be affected.”

Exiled former president Mohammed Nasheed — Mr Yameen’s main political rival — is among the people who were ordered released by the court.

Mr Yameen, in a letter to the court released by his office earlier on Monday, said the order had encroached on the powers of the state and was an “infringement of national security and public interest”. He urged the court to “review the concerns” of the government.

Officials said the court had not properly responded to a series of letters citing problems with implementing the order, including that the cases against the political prisoners are at different legal stages. A supreme court statement on Sunday said “there are no obstacles in implementing the ruling … and that this has been informed to the prosecutor general’s office”.

The supreme court ruled that the politicians’ guilty verdicts had been politically influenced. The ruling has led to protests by opposition supporters urging the government to obey the order.

The United Nations and several foreign governments, including the United States, have urged the Maldives to respect the court order.

Mr Nasheed has been living in exile in the UK since 2016 after being granted asylum when he travelled there on medical leave from prison.

In addition to ordering the release of the political prisoners, the court also reinstated 12 MPs who had been ousted for switching allegiance to the opposition. When those MPs return, Mr Yameen’s Progressive Party of the Maldives will lose its majority in the 85-member parliament, which could result in the legislative body functioning as a rival power to the president.

Known for its luxury tourist resorts, the Maldives became a multi-party democracy 10 years ago after decades of autocratic rule by the current president’s half-brother, Maumoon Abdul Gayoom.

But the nation lost much of its democratic gains after Mr Yameen, who has maintained a tight grip on power, was elected in 2013. He had been set to run for re-election this year virtually unopposed, with all of his opponents either jailed or exiled.

On Friday, Mr Nasheed said he would mount a fresh challenge for the presidency this year. Mr Nasheed was sentenced to 13 years in prison after he was convicted under the Maldives’ anti-terror laws. The trial was widely condemned by international rights groups.