KATTANKUDY, Sri Lanka — When the Wahhabis came, with their austere ideology and abundant coffers, the town of Kattankudy yielded fertile ground.

In this part of Sri Lanka, faith was often the sole sustaining force during the civil war that raged for nearly three decades. Wahhabism — a hard-line strain of Islam blamed for breeding militancy — proposed a direct path to God, albeit one that aimed to return the religion to the time of the Prophet Muhammad.

It was here in Kattankudy’s warren of homes decorated with delicate swirls of Arabic calligraphy that Zaharan Hashim, the man accused of masterminding the Easter Sunday attacks in Sri Lanka, grew up. And it was here that he preached his ideology, calling for the killing of nonbelievers in Islam and even other Muslims.

“To be taken over by radicalism, this is not what we want for Kattankudy,” said Mohamed Ibraheem Mohamed Jaseem, the vice chairman of the town’s urban council. “We are living in Sri Lanka, not a caliphate.”

The Sri Lankan police say that at least two of the suicide bombers involved in the attacks, which killed at least 250 people, were from Kattankudy. The Islamic State claimed responsibility.

Beginning on Friday evening, just down the coast from the town, a raid on a house linked to the Easter bombings turned violent, leaving 15 dead and wounding the wife and child of Mr. Zaharan. Some of the dead, thought to include Mr. Zaharan’s brother and other immediate family, blew themselves up as security forces closed in. The Islamic State also claimed a connection to this shootout.

It was in the 1980s that Kattankudy, one of the few almost exclusively Muslim towns in Buddhist-majority Sri Lanka, began blossoming into a center of Islamic life. The town was enriched by Saudi money for mosques and madrasas, work-abroad contracts and university scholarships.

But the advent of Wahhabism, with its isolating dogma, has also shaken this multifaith island where minority Muslims have traditionally practiced a more inclusive faith. Birthed in Saudi Arabia, Wahhabism’s stern intolerance denigrates not only those who don’t believe in Islam but other Muslim sects as well.

While Saudi Arabia insists the faith does not call for violence, critics have long blamed the kingdom’s mass export of its austere creed for fueling extremism and terrorism abroad. Al Qaeda’s leader, Osama bin Laden, and most of the hijackers in the Sept. 11, 2001, attacks were from Saudi Arabia, and the Islamic State used Saudi religious textbooks inside its self-styled caliphate in Syria and Iraq.

Today in Kattankudy, stately date palms line the main street, as if this lagoon-filled landscape were a desert oasis. Cafes offer tiny cups of syrupy Middle Eastern coffee along with Sri Lanka’s famous tea.

There are more than 60 mosques in Kattankudy for a population of 45,000, and most now subscribe to conservative strains of Islam, including Wahhabism. At the New Kattankudy Grand Jumma Mosque, designed as a replica of Al Aqsa Mosque in Jerusalem, one of Islam’s holiest sites, construction workers are laying intricate blue mosaics as part of the town’s mosque-building boom.

“After the age of 7, everyone must pray five times a day, so we always need more mosques,” said M.I.M. Irfan, the mosque’s secretary.

In an appeal to the Muslim community that supported his government, Mahinda Rajapaksa, Sri Lanka’s former president and an unabashed Buddhist nationalist, came to lay the cornerstone of the Kattankudy Grand Jumma Mosque. Saudi diplomats visited, too.

The Saudis and others from the gulf also supported a plan by M.L.A.M. Hizbullah, a Kattankudy native who is now governor of Eastern Province, to open an Islamic-inspired university campus in his hometown. But a dearth of land in its densely populated neighborhoods meant that the university, a vast edifice of domes and mosaics that is one of the biggest buildings in the province, is being built farther north.

Mr. Hizbullah is against reversing regulations that allow Sri Lankan Muslim men to marry children and have multiple wives. Last week, the authorities brought him in for questioning in connection with a radical group founded by Mr. Zaharan.

That group, National Thowheeth Jama’ath, said it severed ties with Mr. Zaharan two years ago.

The group’s prayer space in Kattankudy is modern and under renovation, a glass-sheathed building with expensive speakers waiting to be installed. Less than a block away stands a disused bus from Yeshua Ministries, an evangelical Christian organization.

Faith mingles in Sri Lanka but it also can combust.

Beginning in 2004, Wahhabi-influenced youth from Kattankudy began attacking Sufis, who practice a mystical form of Islam. Grenades were thrown and swords thrust. Hundreds of Sufis were forced from their homes.

Mr. Zaharan charged with the anti-Sufi brigade.

Although Kattankudy’s Islamic organizations are horrified by Mr. Zaharan’s militancy and have eschewed violence, most have campaigned for years against Sufis.

“Those people, it is not Islam,” said M.L.M. Nassar, a member of the Federation of Kattankudy Mosques and Muslim Institutions. “It’s a deviation.”

During Sri Lanka’s long civil war, which pitted minority Tamils against the Sinhalese majority, Muslims were sometimes caught in the middle. (Accounting for about 10 percent of the population, Muslims are considered a distinct ethnic group in Sri Lanka.)

Some Tamils, who are mostly Hindus or Christians, considered Muslims to be government collaborators. Some Sinhalese, who tend to be Buddhist, distrusted the fact that Muslims in Sri Lanka speak Tamil and populate some areas where Tamils are clustered.

In 1990, at the height of the terror between insurgents from the Liberation Tigers of Tamil Eelam and a Sri Lankan military accused of slaughtering civilians, worshipers gathered in the evening for prayer at the Meera Grand Jumma Mosque in Kattankudy.

It was dark, just another poor town on Sri Lanka’s Tamil and Muslim-dominated east coast bereft of electricity.

M.L.M. Shamsudeen’s 13-year-old son was killed in the attack, along with 16 other relatives. He is now a security guard at the mosque where his family was massacred, keeping vigil amid fears after the Easter killings that mosques might be targeted in retribution.

Sitting on the mosque’s veranda, his eyes filled with tears for his son. He welled up again when he thought of what a hometown boy, Mr. Zaharan, appears to have unleashed at one church in the nearby city of Batticaloa and at two others in or near the capital, Colombo.

The talk of jihad emanating from some of Kattankudy’s hard-line clerics appalled him, he said. Peace finally came to Sri Lanka in 2009. Like so many in the country, Mr. Shamsudeen is done with war.

“We had no weapons to fight back then,” he said of the attack that killed his son and other family members. “But even if we did, is revenge the best way?”

Mr. Shamsudeen did not answer his own question. He shook his head. Just outside the mosque with its bullet-blemished walls, a soldier paced, his rifle alert, a finger poised on the trigger.

POWAY, Calif. — The rabbi had just finished comforting a congregant as she prepared to say the traditional prayer for the dead in honor of her mother when a loud crack rang out in his synagogue.

It was about halfway through the Sabbath service on Saturday when a gunman turned what was supposed to be a time of solace into a day of horror. The rabbi, Yisroel Goldstein, turned quickly to see the body of the woman, Lori Gilbert Kaye, 60, slumped on the floor. He began to rush toward her when he caught sight of several small children watching as the gunman unleashed the attack on Chabad of Poway.

“My instinct was to go to her, but I turned toward a doorway and these little kids were there, so scared,” he said. By then, Rabbi Goldstein had been shot in both hands. “I just grabbed them with my bloody fingers. They were screaming and I was shouting.”

As Rabbi Goldstein ran out with the children, Ms. Kaye’s husband, a physician, ran in to help. But the second he recognized it was his wife on the ground, he fainted. Their only daughter stood a few feet away sobbing in shock, Rabbi Goldstein said.

“It was horrific, utter horror,” Rabbi Goldstein said. “It was like images out of the Holocaust.”

It was only a few months ago, after another hate-fueled attack on a synagogue in Pittsburgh that Rabbi Goldstein completed training for a situation just like this. But it seemed impossible to imagine it would ever happen to his own congregation, he said.

Now Rabbi Goldstein and leaders like him in synagogues and other houses of worship are confronting their new reality. Just like school principals across the country, religious leaders now must take measures to prepare for the horrors of mass shootings. As recent attacks have shown, prayer services are increasingly vulnerable.

The shooting in Poway, about 25 miles north of San Diego, coincides with a significant spike in hate crimes, including acts of anti-Semitism. The gunman, whom police identified as John Earnest, 19, wrote a manifesto echoing the same kind of white supremacist views as the shooters in the attacks in the synagogue in Pittsburgh and on mosques in Christchurch, New Zealand. The latest attack came one week after mass bombings at churches and hotels in Sri Lanka left hundreds dead.

On Sunday, Mr. Earnest was booked on one charge of murder — Ms. Kaye was killed in the attack — and three charges of attempted murder.

Jewish institutions have invested much more significantly in security in the last few years, using private armed security guards, cameras, volunteer patrols and other measures, said Jerry Silverman, the president of the Jewish Federations of North America.

“There’s been a lot to take in already, and yesterday took the Defcon to a whole other level,” he said. “It all has definitely put the Jewish community on alert.”

As hate-filled screeds spewing white nationalist conspiracy theories have ricocheted around the internet, hate crimes have increased in the past few years, according to the F.B.I. And all over the country and the world, houses of worship have tightened security in response to terrorist attacks.

African-American churches have long had to consider the probability of security threats, but recent events are showing many white congregations that their past sense of safety is false, said the Rev. Ronell Howard, pastor of Christ United Methodist Church of Piscataway, N.J.

“When I tell my Caucasian colleagues black churches have always had security as long as I can remember, they are always flabbergasted,” Ms. Howard, 50, said.

Ultimately the increasing violence is less about religion than about fomenting fear and keeping people in a heightened sense of vulnerability, she said. People of faith need to reiterate one message, she said: “We were not given from God this spirit of fear, but of love and of courage.”

The sense of fear and need for increased security is being felt well beyond the United States.

The Sri Lankan government has said the church bombings may have been in retaliation for the mosque shootings in New Zealand. And the day after the Christchurch terror attack, Shabbat services at synagogues across the country were canceled on the advice of the police. While New Zealand police are no longer providing round-the-clock armed guard at mosques, as they did immediately after the shooting, the mosques that were attacked still have protection.

Barry Werber, who survived the Tree of Life shooting, said he could hardly believe that any service would meet without security. As sad as it makes him, meeting without armed security is now simply shortsighted, he said.

“I had family in the concentration camps; they came over to escape that,” said Mr. Werber, 77, whose parents immigrated to the United States from Poland. “Now it’s raising its head all over again.”

Since the October attack, two of the congregations that had met at Tree of Life have been meeting in chapels at a synagogue nearby — and armed security guards now greet people at the doors.

“How do you not provide that?” asked Aaron Bisno, the rabbi of the host synagogue. This heightened security protocol does comes with a steep price. Two security guards for 13 hours costs more than $1,000 a day, Rabbi Bisno said, a cost prohibitive for many congregations, especially smaller ones. That is particularly demanding these days, when memberships at churches and synagogues nationwide are dwindling in numbers and resources.

Since the Pittsburgh attack in October, the Jewish Community Relations Council of New York has conducted over 200 security assessments of synagogues by request and has received inquires from additional synagogues since Saturday.

Dozens of synagogues in the city now employ armed security guards, while others which cannot afford to hire armed security have created plans involving blockading attackers from entering synagogue doors and strategies for evacuation in case of an active shooter, according to David Pollock, director of public policy and security at the council.

“Nationally our law enforcement agencies need to step up and acknowledge that our houses of worship are being preyed upon,” said Eric L. Adams, the Brooklyn borough president and a retired captain of the New York Police Department. “Now that we have this new level of clear targeting of houses of worship we have to step outside our box and reshape how we think proactively about security.”

On Sunday morning, Rabbi Goldstein thought of the young children who witnessed the attack, including his 4-year-old granddaughter. “She doesn’t deserve that. Our people, we’ve been through hell and back. I need our Jewish brethren to stand strong and really, really be proud of our heritage.”