The UN's top court on Thursday ordered Pakistan to stay the execution of an Indian national convicted of spying, in a decision hailed by New Delhi.
Judges at the International Court of Justice (ICJ) ruled in a unanimous and binding decision that Kulbhushan Sudhir Jadhav must not be executed by Islamabad until they have had time to pass final judgement in the case.
Jadhav was arrested in the restive southwestern Pakistani province of Balochistan in March 2016 and Pakistani officials claim he has confessed to spying for Indian intelligence services. He was convicted last month by a military court and sentenced to death.
But India has maintained he is not a spy, and lodged a case against Pakistan earlier this month, accusing Islamabad of violating the Vienna Convention by failing to provide him with consular access, as well as breaking international human rights law.
New Delhi also appealed for the court to impose emergency measures to suspend Jadhav's execution until the legal battle in The Hague has concluded.
"Pakistan shall take all measures at its disposal to ensure that Mr Jadhav is not executed pending the final decision in these proceedings," said the court's president Ronny Abraham.
He also ordered Pakistan to inform the tribunal that it has implemented the decision, and stressed that ICJ decisions are binding on all member states.
Indian Foreign Minister Sushma Swaraj welcomed the ruling and said in a Tweet that it was "a great relief to the family of Kulbhushan Jadhav and people of India".
"I assure the nation that under the leadership of Prime Minister (Narendra) Modi we will leave no stone unturned to save #KulbhushanJadhav," he said in another Tweet.
Outlining the reasons for its decision, Abraham said Pakistan had "given no assurance" Jadhav would not be executed before the court delivered its final decision.
"The mere fact that Mr Jadhav is under a death sentence and might therefore be executed is sufficient to demonstrate the existence of a risk of irreparable prejudice to the rights claimed by India," he added.
Therefore the court was "satisfied" of the "urgency" of the case.
The case -- a rare foray for the two South Asian nations into the international courts -- has highlighted the recent sharp upsurge in tensions between the nuclear-armed rivals.
The ICJ was set up in 1945 to rule on disputes between nations in accordance with international law. The tribunal has not yet decided whether it has jurisdiction to hear India's case, and a final ruling could take months, if not years.
Outside his former home in Mumbai, a group of friends let off firecrackers in celebration as the decision was made public.
"We are very happy with the world court's verdict in Kulbhushan Jadhav's case. Justice has been served and it is proven that Pakistan's courts are mere kangaroo courts and nothing else," one friend Sachin Kale told AFP.
Jadhav reportedly joined India's prestigious National Defence Academy in 1987 and was commissioned as an engineer in the Indian Navy in 1991.
The son of a retired police office, his neighbours in Mumbai where he lived with his wife and two children, remember him as a shy but helpful man who was good at sport and academic, according to the Hindustan Times newspaper.
Indian lawyer Deepak Mittal had told the ICJ in a day-long emergency hearing on Monday that Jadhav was "an innocent Indian national" who had been held incommunicado "for more than a year on concocted charges".
But Pakistani representatives accused New Delhi of "political grandstanding" and told the court Jadhav "has confessed to having been sent by India to wage terror on the innocent civilians and infrastructure of Pakistan".
The last time India and Pakistan took a dispute to the ICJ was in 1999 when Islamabad protested against the downing of a Pakistani navy plane that killed 16 people. But the tribunal decided in 2000 that it was not competent to rule in the dispute and closed the case.