The new ruling comes as President Abdulla Yameen moved to assert his power over judges, declaring a state of emergency and ordering security forces to raid the court compound where the justices were arrested.
The Maldives highest court on Tuesday revoked an order to release high-profile political prisoners a day after President Abdulla Yameen declared a state of emergency in the honeymoon islands and arrested two top judges on corruption charges.
The remaining three judges of the Supreme Court said they were rescinding their February 1 order to release the prisoners "in light of the concerns raised by the President".
"The Supreme Court bench hereby rescinds number 5 of its order to release the individuals," a statement said.
The court's original decision signed by all five judges of the apex court had quashed a terrorism conviction against former president and opposition leader Mohamed Nasheed, among others.
The shock move was seen as clearing the way for Nasheed to end his self-imposed exile and return to the country to contest elections later this year.
But Yameen refused to comply with the order and instead declared the 15-day state of emergency, giving sweeping powers to troops to arrest and detain individuals while curtailing the powers of the judiciary and the legislature.
Maldives Chief Justice Abdulla Saeed and another judge were then arrested at dawn on Tuesday, after security forces stormed the court complex in the capital Male.
The latest U-turn of the court would take Nasheed back to square one and is seen by opposition activists as a blow to their attempts at toppling Yameen – accused of plunging the tiny Indian Ocean nation into political turmoil.
However, the Supreme Court made no change to their other order to restore the seats of 12 legislators sacked for defecting from Yameen's party.
This, in theory, gives the dissidents a majority in the assembly, but they are prevented from ousting the president because the declaration of a state of emergency takes away parliament's power to impeach.
Nasheed has accused Yameen of acting illegally and called on the international community to step in and help remove him from office.
On Tuesday, he urged India to send troops to the strategically located archipelago, which has grown increasingly close to regional rival China under Yameen's leadership.
"President Yameen has illegally declared martial law and overrun the state. We must remove him from power," said Nasheed, the first democratically-elected leader of the Maldives, in a statement.
"We would like the Indian government to send an envoy, backed by its military, to free the judges and the political detainees."
Nasheed's Maldivian Democratic Party (MDP) said the U-turn of the Supreme Court was due to pressure brought on the three judges.
"Yameen has used coercion to get the original decision revoked," MDP spokesman Hamid Abdul Ghafoor said in Colombo.
Yameen has presided over an escalating crackdown on dissent since he came to power in 2013, battering the image of the upmarket holiday paradise.
London-based Amnesty International called for the immediate release of the detained judges warning that the "eyes of the world" were on the worsening crisis in the troubled archipelago.
The United States said earlier it was "troubled and disappointed" at the declaration of a state of emergency and called on Yameen to comply with the rule of law.
Several countries have warned against travel to the country, which depends heavily on tourism, at the peak of the season.
In a televised address to the nation, Yameen accused the judges of being part of a plot to overthrow him.
"I had to declare a national emergency because there was no other way to investigate these judges," he said.
"We had to find out how thick the plot or coup was."
Yameen has had almost all the political opposition jailed since he came to power.
A band of thugs armed with knives drove by my residence several times after midnight last night shouting abuse at the top of their voice. I wonder who would have sent these unruly thugs? @PoliceMv and @MNDF_Official must investigate and take action— Maumoon Abdul Gayoom (@maumoonagayoom) February 5, 2018
On Monday he ordered the arrest of his estranged half-brother and former president Maumoon Abdul Gayoom, who had sided with the main opposition.
The 80-year-old president for 30 years until the country's first democratic elections in 2008 was taken from his home in the capital Male around midnight on Monday, hours after the emergency was declared.
"I have not done anything to be arrested," Gayoom said in a video message to supporters posted on Twitter.
"I urge you to remain steadfast in your resolve too. We will not give up on the reform work we are doing."