The International Court of Justice has ordered a review in the case of an Indian man sentenced to death by Pakistan for alleged spying.
Kulbhushan Jadhav, a retired Naval officer, was arrested in March 2016 and subsequently sentenced to the death penalty for espionage and terrorism.
The ICJ, based in The Hague in the Netherlands, on Wednesday ruled in favour of India, which accused Pakistan of violating international law by denying him consular access.
It ordered a stay of execution for a review of the conviction and sentence to be carried out.
The decision is likely to stoke mounting tensions between the two countries, which are both nuclear powers.
Judge Abdulqawi Ahmed Yusuf, President of the ICJ, read the court’s ruling in full in a public hearing.
He said that Pakistan was found to have breached its obligations to allow Indian consular representatives access to Jadhav during his detention.
The judge added that the failures amounted to “internationally wrongful acts” and that Pakistan is under an obligation to cease those acts and start complying with international law.
ICJ rulings are legally binding but the Court does not have any powers to enforce them.
Pakistan said Jadhav was detained in the Balochistan province but Delhi claimed he was kidnapped in Iran during a business trip.
Islamabad announced shortly after his arrest that he had admitted being a spy and released a video allegedly showing him making a confession.
In April 2017 Pakistan said he had been convicted of espionage and terrorism at a military court and sentenced him to death.
India denied that Jadhav was a spy and said his confession had been made under duress.
ICJ proceedings began on May 8, 2017, when India alleged that Pakistan had violated the Vienna Convention on Consular Relations by denying Jadhav access.
Indian Prime Minister Narendra Modi tweeted in reaction to the ruling: "Truth and justice have prevailed. Congratulations to the ICJ for a verdict based on extensive study of facts.
"I am sure Kulbhushan Jadhav will get justice. Our Government will always work for the safety and welfare of every Indian."
A statement from the Ministry of External Affairs said that it welcomes the judgement and appreciates the direction for a review of the case.
"We note that the Court has directed that Pakistan is under an obligation to inform Shri Jadhav without further delay of his rights and to provide Indian consular officers access to him in accordance with the Vienna Convention," it added.
"We expect Pakistan to implement the directive immediately.
"Pakistan had said that he was not entitled to consular assistance because he was a spy."
It continued: "This landmark judgement validates India's position on this matter fully.
"We will continue to work vigorously for Shri Kulbhushan Jadhav's early release and return to India."
Pakistan's Foreign Minister Shah Mahmood Qureshi ?tweeted after the ruling: "Commander Jadhav shall remain in Pakistan.
"He shall be treated in accordance with the laws of Pakistan. This is a victory for Pakistan."
The country's foreign ministry said in a statement that Jadhav entered Pakistan without a visa and with a fake alias.
It repeated allegations that he was responsible for "acts of sabotage, espionage and multiple terrorist incidents" and added that he had "confessed all these acts during his trial in Pakistani court in front of a Judicial Magistrate".
Wednesday’s court ruling came amid heightened tensions between the neighbouring countries in south Asia.
They came to the brink of war in February over a long-running dispute over the territory of Kashmir. EFE-EPA