LAHORE, Pakistan — Suicide bombers attacked two Christian churches during Sunday services in the Pakistani city of Lahore, killing at least 15 people and wounding dozens in the latest attack on religious minorities in the country.

The attacks occurred in quick succession outside Catholic and Protestant churches in Youhanabad, one of Pakistan’s biggest Christian neighborhoods.

A man rigged with explosives blew himself up outside the main gate of St. John’s Catholic Church after being prevented from entering by a security guard, said Haider Ashraf, a senior police officer.

A second blast went off minutes later in the compound of Christ Church, about half a 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 dead bodies on fire.

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 TV 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.

Religious minorities including Shiites, Christians, and Ahmadi Muslims have been under violent attack for years in Pakistan. At least 85 people were killed in an attack on All Saints Church in Peshawar in September 2013.

There have also been sporadic attacks on Christians in Punjab, the country’s most populous province, often prompted by accusations of blasphemy against the Prophet Muhammad.

But Pakistan has been particularly on edge in recent months since a Taliban assault on a Peshawar school that killed at least 150 people, most of them children.

Nabila Ghazanfar, a spokeswoman for the Punjab police, said the deaths from the attack Sunday included 13 worshippers, two police officers deployed for security outside the churches and the two suspects beaten to death by the mob, in addition to the two bombers.

Television images showed police officials struggling to keep the angry crowd away from one of the men who was later lynched.

Dr. Muhammad Saeed, the chief doctor at Lahore General Hospital, where scores of the wounded were brought, said that many were in critical condition.

Sohail Johnson, a witness who lives close to the churches, said the Sunday services were usually attended by more than 1,000 worshippers.

Prime Minister Nawaz Sharif of Pakistan strongly condemned the blasts, saying the anger and grief shown by members of the Christian community in the aftermath of the episode strengthen the government’s resolve to counter the menace of terrorism.