Bibi, a mother of five from Pakistan’s Punjab province, was convicted of blasphemy in 2010 and sentenced to hang after she was accused of defiling the name of the Prophet Muhammed during an argument with her neighbours.

He said Bibi can walk free from jail in Sheikupura, near Lahore, immediately if not wanted in connection with any other case. She was not in court to hear the ruling.

The verdict was read out amid strong security measures with members of riot police and bomb specialists deployed at the entrance of the Supreme Court.

Inside the room, unarmed commandos of the anti-terrorist corps were deployed to maintain security.

Bibi had lost the appeal filed at the Lahore High Court in 2014. In 2015, the Supreme Court stayed the execution order, saying it would study the appeal, whose first hearing, set for 2016, was postponed after one of the judges was challenged.

The Supreme Court on October 8 studied the appeal against the death sentence of Bibi and said there were contradictions in the witnesses’ statements.

The radical Tehreek-e-Labbaik Pakistan party previously threatened the judges with dangerous consequences if Bibi were acquitted. A few days later thousands of Islamists in cities across Pakistan demanded her execution.

Under the Pakistan penal code, the offence of blasphemy is punishable by death or life imprisonment.

Widely criticised by international human rights groups, the law has been used disproportionately against minority religious groups in the country and to go after journalists critical of the Pakistani religious establishment.

Bibi’s case has attracted widespread outrage and support from Christians worldwide and condemnation from conservative Islamist groups in Pakistan, who have demanded the death penalty and threatened widespread protests in the event of her being freed.

In 2011, senior politician Salman Taseer was shot dead by his own bodyguard for voicing support for Bibi and condemning the country’s stringent blasphemy laws.

His killer, Mumtaz Qadri, then surrendered to the police and was later executed, becoming a “martyr” for many hardline Islamists.

Also in 2011, a Christian minority minister, Shahbaz Bhatti, was shot dead at his home for defending Bibi and opposing anti-blasphemy legislation.