Afghan President Ashraf Ghani has called for an investigation after a mob beat a woman to death in the capital, Kabul, and then set her body on fire.
The woman had been accused of setting fire to copies of the Koran in a nearby mosque.
President Ghani said no-one had the right to stand in judgement and use violence to punish others.
At least four suspects have been arrested in connection with the incident.
The family of the woman, named by Afghanistan's Tolo news agency only as Farkhunda, said she had been mentally ill for some years.
Her parents told Tolo she had not intentionally burnt the Koran.
The BBC's David Loyn in Kabul said some bystanders tried to hold the mob back as the woman was dragged from the Shah-Du-Shamshaira mosque.
After she had been beaten to death, her body was thrown down the bank of a river and set alight.
A number of police from different forces were close by, our correspondent says, including anti-terrorist officers protecting the centre of Kabul.
The head of Kabul's criminal investigation division, Mohammad Farid Afzali, said officers had fired into the air to try to disperse the crowd, but had "reacted too late".
Mr Ghani said in a statement: "No-one has the right to take it upon themselves to act as judge and court, nor to commit violence against anyone for any reason."
He ordered an inquiry into the attack to be conducted by the interior ministry together with the Ulama Council - which oversees religious issues - and the leadership of the mosque.
An Ulama Council member, Ahmad Ali Jebreili, condemned the attack and said it was against Islamic law.