Mass shootings have become a recurring part of American life, and religious institutions a recurring setting. In each case, the shock is compounded by the violence at what is supposed to be a safe space for peace and healing.

26 people were killed at a Texas church in 2017

The authorities said Devin Patrick Kelley, 26, was clad in all black, with a ballistic vest strapped to his chest and armed with a military-style rifle, when he quickly attacked the small church, pausing only to reload.

Mr. Kelley died of a self-inflicted gunshot wound.

Law enforcement authorities have said the shooting might have stemmed from a dispute between Mr. Kelley and his mother-in-law. She and several others from that side of the family were regulars at the church. But on the morning of the shooting, Mr. Kelley’s mother-in-law was at home with her grandson.

Nine people were killed at a historic black church in South Carolina in 2015

Mr. Roof, then 21, entered through an unlocked side door of the Emanuel African Methodist Episcopal Church and took a seat at a weekly Bible study meeting. He had brought with him a semiautomatic pistol that he concealed in a pack on his waist.

When the congregants closed their eyes for a familiar benediction, the sound of gunfire roared through the fellowship hall. Churchgoers dove below tables but Mr. Roof kept firing, striking the victims at least 60 times.

Mr. Roof was charged with 33 counts, including hate crimes resulting in death. He was found guilty in 2016 and sentenced to death last year.

At Emanuel A.M.E. Church, a bedrock of black Charleston that was founded in 1791, doors that were once left open have had to be locked since the shooting. The church has used retired military and on- and off-duty police officers for security.

Willi Glee, a member of the church, said last year that religious spaces offer an added attraction for some attacks because defiling them is the ultimate taboo. “Everybody expects that a house of worship is a safe place,” he said.

Image

Investigators at the Sikh temple in Oak Creek, Wis., where a gunman killed six people in 2012.CreditJohn Gress/Reuters

Six people were killed at a Sikh temple in Wisconsin in 2012

In 2012, a Sikh temple in Oak Creek, Wis., was getting ready for Sunday services when an armed man walked in and started firing.

Congregants ran for shelter and barricaded themselves in bathrooms and prayer halls, where they made desperate phone calls and sent anguished texts pleading for help as confusion and fear took hold.