Former Maldives President Mohammad Nasheed

India on Friday called for peace and stability in the Maldives after clashes erupted in the Indian Ocean archipelago after the Supreme Court ordered the release of exiled former President Mohamed Nasheed along with other high-profile prisoners.

"We have seen last night's order of the Supreme Court of Maldives releasing all political prisoners," the External Affairs Ministry said in a statement. 

"In the spirit of democracy and rule of law, it is imperative for all organs of the government of Maldives to respect and abide by the order of the apex court," it stated. 

It also called upon the Maldivian authorities to ensure the safety and security of the Indian expatriates in Maldives under all circumstances.

"As a close and friendly neighbour, India wishes to see a stable, peaceful and prosperous Maldives," the statement said.

Clashes erupted in the Maldives between police and supporters of Nasheed on Friday as they took to the streets celebrating the ruling by the Supreme Court to release the exiled leader.

The top court on Thursday night declared that "the trials violated constitutional and international law", the BBC reported.

It called for their immediate release and said the "questionable and politically motivated nature of the trials of the political leaders warrant a re-trial".

Former Vice President Ahmed Adheeb Abdul Ghafoor and other opposition leaders were among the others named in the latest order. The decision effectively restores the opposition majority in Parliament, reinstating 12 members who had been stripped of their seats.

Hundreds of Nasheed supporters took to the streets to celebrate but clashes broke out after President Yameen Abdul Gayoom fired the country's police chief, whose department had announced that it would uphold the verdict.

Police fired tear gas to disperse opposition supporters gathered in the capital while riot police urged people not to take part in any protests and asked everyone to immediately leave, the local media reported.

Nasheed, the country's first democratically elected leader, took office in 2008. He was ousted in a coup in February 2012.

The country has seen political unrest since he was sentenced to 13 years in jail in 2015 on terrorism charges after allegedly ordering the arrest of a judge during his presidency.