In a big win for India, the International Court of Justice (ICJ) on Wednesday gave consular access to Kulbhushan Jadhav, who was arrested and given death sentence by Pakistan on charges of espionage.

Upholding India's stand that Pakistan has violated the 1963 Vienna Convention, the ICJ said that Jadhav's trial by a military court in Pakistan is not accepted thereby stopping his execution.

Also read: Full text of ICJ order in Kulbhushan Jadhav case

The death sentence by a Pakistani military court was questioned by India, which said its based on an "extracted confession". Jadhav, a former Indian navy commander, was arrested in Pakistan in March 2016 and convicted of spying.

In hearings before the 15-judge panel earlier this year, India had demanded full consular access to Jadhav and argued that the ICJ should annul the decision of Pakistan's military court.

While Pakistan sent a 13-member team to the ICJ for today's verdict, India was represented by Joint Secretary Deepak Mittal and officers from the Legals and Treaties Division of the Ministry of External Affairs.

The death sentence, given by a military court in Pakistan, had evoked sharp reactions in India.

India filed a claim against Pakistan before the ICJ in May 2017 arguing Islamabad had breached the 1963 Vienna Convention by not allowing diplomatic assistance to Jadhav during his secretive trial. Harish Salve, who was representing India in the case, questioned the functioning of Pakistan's notorious military courts and urged the top UN court to annul Jadhav's death sentence, which is based on an "extracted confession".

Watch: ICJ asks Pak to review Jadhav's conviction, allows consular access

Pakistan said that India was trying to use the court intended to resolve international disputes as a criminal appeals court. They also said the relief sought by India was disproportionate even if the treaty were violated, and at most Jadhav's case could be reviewed.

The ICJ is the United Nation's highest court, and its decisions are binding - though it has no power to enforce them and they have been ignored in rare instances.