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 protests by hardliners who support strong blasphemy laws.
There was a heavy police presence at the Supreme Court in Islamabad as many feared violence could break out.
People have also been gathering for protests against the verdict in Karachi, Lahore and Peshawar, and hundreds blocked a road between Rawalpindi and Islamabad, Dawn newspaper reported.
Chief Justice Saqib Nisarm, 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 are Pakistan's blasphemy laws?
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 protesters hold banners demanding death for blasphemers in Karachi, Pakistan (12 Oct 2018)]
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.
No-one has ever been executed, but some people accused of the offence have been lynched or murdered.
Asia Bibi, who has four children, was the first woman to be sentenced to death under the laws.
What happens now?
There are fears that there could be a violent response to her acquittal.
[Ashiq Mesih (R) and Eisham Ashiq, the husband and daughter of Asia Bibi speak in London] Image copyrightAFP
Image captionAsia Bibi's husband and daughter say they fear for their safety in Pakistan
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 was expected to leave the country if acquitted.
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.
Courtesy of BBC World News
Related project: Miracle School (Anti-Slavery and Education)