When he told her to leave people alone, she turned on Mr. Mohammad. “She called me a two-rupee beggar and told me sit here quietly,” he said.

Later Farkhunda began to pace the shrine’s courtyard. Along the wall is a small metal firepit, where visitors throw orange rinds, soda cans and other trash from picnics.

It was there that several women, who were busy preparing meals for beggars, saw Farkhunda standing over flames, Mr. Mohammad said. Soon the women began shouting that chapters from the Quran were on fire, Mr. Mohammad said.

Exactly what Farkhunda was burning is not certain. The independent television channel Tolo News, citing a government official in the Religious Affairs Ministry, said that the burned pages were not from the Quran — the words were in Dari, not Arabic.

But when another of the shrine’s attendants, Zain-Ul-Din, rushed back to the firepit and pulled out the charred pages, he wasted no time in whipping up a mob. He laid the pages on a wood plank, which he then carried out to the street. There, according to witnesses, he began shouting: “The woman has burned the holy Quran! An infidel woman had burned the holy Quran!”

A crowd gathered within minutes, and it kept growing until it was hundreds strong. The men quickly cornered Farkhunda and began pelting her with rocks, while others egged the rock throwers on. Some men stomped on her as she lay in the street.

Police officers tried to intervene. They fired warning shots, and at one point a few members of the crowd joined the police in trying to save her. They pulled and pushed her out of the crowd and up onto a corrugated metal roof of an adjoining building, apparently hoping to find a way out of the courtyard. But Farkhunda fell — or was pushed back — into the mob.