A second blast went off minutes later in the compound of Christ Church, about a half-mile away.

In the aftermath of the attacks, an enraged crowd lynched two people suspected of being accomplices in the bombings, one of whom was wrenched from police custody. Local news outlets reported that the mob set their bodies on fire.

Image A family mourned a boy who was killed in a suicide attack in Lahore on Sunday. Credit... K.M. Chaudary/Associated Press

The crowd also prevented the police from entering the scene of the attacks, and angry protests spread across the city. Demonstrations were also reported in Karachi and other cities.

Jamaat-ul-Ahrar, a splinter faction of the Pakistani Taliban, claimed responsibility for the attack.

Local television stations broadcast images of wailing and distraught relatives in hospital corridors. One woman wept hysterically as relatives tried to calm her.

Pervez Masih, 45, who was in one of the churches, said the explosion went off just as the prayer service was concluding. “Afterward people were running here and there, trying to save their lives,” he said.