Pakistan's highest court on Wednesday ordered the release of a poor, illiterate Christian woman who had been sentenced to death for blasphemy, setting off a wave of demonstrations by hard-line Islamists nationwide but drawing praise from human rights activists.

The Supreme Court overturned the conviction against Asia Bibi, accused in 2009 of insulting the Prophet Muhammad in a case that sparked violent protests in the overwhelmingly Muslim nation of 200 million people. Two Pakistani government officials were murdered in 2011 in crimes linked to their support of Bibi.

“It's ironic that in the Arabic language the appellant’s name Asia means ‘sinful,’ the judges wrote. "But in the circumstances of the present case she appears to be a person, in the words of Shakespeare’s King Lear, ‘more sinned against than sinning’.”

Chief Justice Saqib noted that tolerance is the "basic principle" of Islam.

Pakistan Peoples Party leader Sherry Rehman cheered the verdict on Twitter: "False accusers took half her life away. Now the state must protect all those who stand for the rule of law and justice. We have all been witness to the havoc mobs have wreaked to red lines before."

But the future of blasphemy laws in Pakistan is far from settled. The laws remain popular in Pakistan, and Prime Minister Imran Khan expressed support for them during the recent election campaign.

After the decision on Bibi was announced, the Islamist political party Tehreek-e-Labaik said Saqib and the other judges deserve death under Islamic law. That drew a sharp rebuke from Khan.

“The state will fulfill its responsibility of protecting the lives and properties of people and take strict action against violators," he said in a speech broadcast across the country.

Bibi's case stemmed from a simple act among poor farmhands in rural Pakistan. Bibi was asked to get water while harvesting fruit in a field. Muslim women working with Bibi complained when she dipped her cup into the water bucket, saying a non-Muslim was unclean.

The women quarreled, and her co-workers accused her of insulting the prophet three times. She was later beaten, and the women complained to a local religious leader who pressed for the blasphemy charge. Insulting Islam's prophet is considered blasphemy carries a death sentence under Pakistani law.

Bibi, a mother of five, was convicted and sentenced to death in November 2010. The verdict was upheld five years later.

Bibi has been kept in solitary confinement, mostly for her own protection, since her 2010 conviction. Pope Benedict and later Pope Francis were among world leaders who had called for her release.

She is scheduled for release later this week, and authorities said she might leave the country for security reasons.

“I can’t believe what I am hearing,” Bibi told AFP by phone from prison after the ruling. “I just don’t know what to say, I am very happy, I can’t believe it.”

The United States Commission on International Religious Freedom hailed the decision and urged Pakistan officials to take steps to ensure her safety. The group also called for release of the estimated 40 people who remain on death row for blasphemy convictions.

Blasphemy laws protect entire religions rather than the rights of individuals, falling short of international human rights standards, commission chairman Tenzin Dorjee said.

“The case of Asia Bibi illustrates the extent to which blasphemy laws can be exploited to target minority communities," Dorjee said. "It is deeply troubling that Bibi’s case even reached this level, where she almost became the first person in Pakistan’s history to be executed for the crime of blasphemy.”

Amnesty International called the decision a "landmark verdict" for religious tolerance.

"Pakistan’s blasphemy laws are overbroad, vague and coercive," the group said in a statement. "They have been used to target religious minorities, pursue personal vendettas, and carry out vigilante violence."