A Pakistani court has overturned the death sentence of a Christian woman convicted of blasphemy, a case that has polarised the nation.
Asia Bibi was convicted in 2010 after being accused of insulting the Prophet Muhammad in a row with her neighbours.
She always maintained her innocence, but has spent most of the past eight years in solitary confinement.
The landmark ruling has already set off violent protests by hardliners who support strong blasphemy laws.
Demonstrations against the verdict are being held in Karachi, Lahore, Peshawar and Multan. Clashes with police have been reported.
The Red Zone in the capital Islamabad, where the Supreme Court is located, has been sealed off by police, and paramilitary forces have been deployed to keep protesters away from the court.
Chief Justice Saqib Nisar, who read out the ruling, said Asia Bibi could 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, but reacted to the verdict from prison with apparent disbelief.
"I can't believe what I am hearing, will I go out now? Will they let me out, really?" AFP news agency quoted her as saying by phone.
What was Asia Bibi accused of?
The trial stems from an argument Asia Bibi, whose full name is Asia Noreen, had with a group of women in June 2009.
They were harvesting fruit when a row broke out about a bucket of water. The women said that because she had used a cup, they could no longer touch it, as her faith had made it unclean.
Prosecutors alleged that in the row which followed, the women said Asia Bibi should convert to Islam and that she made three offensive comments about the Prophet Muhammad in response.
She was later beaten up at her home, during which her accusers say she confessed to blasphemy. She was arrested after a police investigation.
Fallout to continue
By Secunder Kermani, BBC News, Islamabad
The court delivered its verdict quickly, no doubt aware of the sensitivity of the case and the danger of a violent reaction to it.
Asia Bibi's lawyer, closely flanked by a policeman, told me he was "happy" with the verdict, but also afraid for his and his client's safety.
Even after she is freed, the legacy of her case will continue. Shortly after her conviction a prominent politician, Punjab Governor Salman Taseer, was murdered for speaking out in her support and calling for the blasphemy laws to be reformed.
The killer - Mumtaz Qadri - was executed, but has become a cult hero with a large shrine dedicated to him on the outskirts of Islamabad.
His supporters also created a political party - campaigning to preserve the blasphemy laws - which gathered around two million votes in this year's general election.
It's the same party which many fear could be responsible for violent unrest in the coming days.
What is blasphemy in Pakistan?
Laws enacted by the British Raj in 1860 made it a crime to disturb a religious assembly, trespass on burial grounds, insult religious beliefs or intentionally destroy or defile a place or an object of worship, punishable by up to 10 years in jail.
Several more clauses were added in the 1980s by Pakistan's military ruler Gen Zia ul-Haq:
- 1980 - up to three years in jail for derogatory remarks against Islamic personages
- 1982 - life imprisonment for "wilful" desecration of the Koran
- 1986 - "death, or imprisonment for life" for blasphemy against the Prophet Muhammad
What did the Supreme Court say?
The judges said the prosecution had "categorically failed to prove its case beyond reasonable doubt".
The case was based on flimsy evidence, they said, and proper procedures had not been followed. The alleged confession was delivered in front of a crowd "threatening to kill her".
The ruling heavily referenced the Koran and Islamic history. It ended with a quote from the Hadith, the collected sayings of the Prophet Muhammad, which calls for non-Muslims to be treated kindly.
Why is this case so divisive?
Islam is Pakistan's national religion and underpins its legal system. Public support for the strict blasphemy laws is strong.
Hardline politicians have often backed severe punishments, partly as a way of shoring up their support base.
But critics say the laws have often been used to get revenge after personal disputes, and that convictions are based on thin evidence.
The vast majority of those convicted are Muslims or members of the Ahmadi community, but since the 1990s, scores of Christians have been convicted. They make up just 1.6% of the population.
The Christian community has been targeted by numerous attacks in recent years, leaving many feeling vulnerable to a climate of intolerance.
Many of the attacks are motivated by blasphemy cases, but others have come in reaction to the US-led war in Afghanistan.
No-one has ever been executed under the laws, but some people accused of the offence have been lynched or murdered.
Asia Bibi, who was born in 1971 and has four children, was the first woman to be sentenced to death under the laws.
Internationally, her conviction has been widely condemned as a breach of human rights.
What happens now?
There are fears that there could be a violent response to her acquittal.
As with her previous trials and appeals, large crowds gathered outside the court in Islamabad on Wednesday demanding her conviction be upheld and the execution carried out.
She has been offered asylum by several countries and is expected to leave the country.
Her daughter, Eisham Ashiq, had previously told the AFP news agency that if she were released: "I will hug her and will cry meeting her and will thank God that he has got her released."
But the family said they feared for their safety and would likely have to leave Pakistan.