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 is a heavy police presence at the Supreme Court in Islamabad as many feared violence could break out.
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.
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.
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.
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.
Most of those convicted are Muslims, but since the 1990s, scores of Christians have been convicted.
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.
Asia Bibi's case gained even more prominence after the assassination of Salman Taseer, the governor of Punjab province. He had called for her to be pardoned and for the blasphemy laws to be overhauled.
He was shot dead in broad daylight in early 2011 by his security guard, Mumtaz Qadri, a supporter of the strict blasphemy laws. Qadri was sentenced to death and executed in 2016 but remains a hero to many.
Internationally, Asia Bibi's conviction has been widely condemned as a breach of human rights.
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 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.