Want smart analysis of the most important news in your inbox every weekday along with other global reads, interesting ideas and opinions to know? Sign up for the Today’s WorldView newsletter.

From some angles, the terrorist attacks that devastated Sri Lanka on Sunday look vastly different from the one that took place in New Zealand last month. They took place in different countries using different weapons. They targeted different religions and were motivated by different ideologies.

In Sri Lanka, coordinated bombings killed Christians at churches and tourists at hotels; the Islamic State later claimed credit for the attacks, which killed more than 350 people. Just a month earlier, on March 15, Brenton Tarrant, a 28-year-old Australian, shot and killed 50 Muslims attending Friday prayers at two mosques in Christchurch, New Zealand.

Still, some see connections between these events — Sri Lankan officials suggested the bombings on Easter Sunday may have been in retaliation to last month’s attack in Christchurch. Ruwan Wijewardene, Sri Lanka’s state minister of defense, told reporters Tuesday that the attacks in his country were “motivated” by the attack in New Zealand.

It’s not the only attack Tarrant may have inspired: On Thursday, Turkey detained a suspected member of the Islamic State who it believes planned to attack Australians and New Zealanders.

It is unclear if Wijewardene found specific evidence of the Sri Lankan attackers’ motivations. Such an extensive plot would have been difficult to organize — it involved eight bombings in three cities — and the Islamic State’s announcement Tuesday that it was responsible made no mention of the massacre in New Zealand.

Determining the motivations behind extremist acts can be challenging, experts say, and extremists are generally vague about their reasoning. “Terrorist organizations are often opportunistic in the way that they claim justification or rationalization for their attacks,” Nicholas Rasmussen, a former senior director for counterterrorism on the National Security Council, told my colleagues this week.

Even if the New Zealand shootings did not directly motivate the bombings in Sri Lanka, the events are similar in that they both targeted a religious minority in houses of worship. They did so not because of local concerns, but because of delusions about a global clash of civilizations.

The nature of the relationship between the attackers in Sri Lanka and the Islamic State is not yet known. The militant group has had a hand in planning complex and devastating attacks around the world, but also regularly claims attacks it is said to have “inspired.”

Even so, the fact that a group of Sri Lankan Muslims chose to claim allegiance to the Islamic State and target the country’s Christian community and popular tourist areas suggests a global audience in mind. As Amarnath Amarasingam, a senior research fellow at the Institute for Strategic Dialogue, told Today’s WorldView on Sunday, a locally minded group probably would have targeted Sri Lanka’s Buddhist majority.

In New Zealand, Tarrant was thinking internationally, too. On a Twitter account created just days before the shootings, he published a 74-page manifesto that offered a lurid vision of his racist worldview. During the attack, he used a mounted camera to live-stream his violence to an online audience. Despite attempts to restrict access to the manifesto and the footage online, the information quickly spread.

Tarrant offered his own version of a pledge of allegiance, claiming he had contacted a reborn Knights Templar group — a militant order with a fearsome reputation in battles against Muslim adversaries in the medieval Crusades — and received the blessing of Norwegian extremist Anders Breivik, who killed 77 people in attacks on Oslo and a nearby island in 2011. This idea may have been aspirational: Breivik’s lawyer has cast doubt on the idea his client could have had contact with the outside world.

There is no indication Tarrant had the backing of an international group, and he would not have needed it anyway. Still, both he and the more-organized terrorists in Sri Lanka chose to attack the same soft target — and the vulnerability of the their victims resonated around the world.

Experts worry about simplifying the response to the attacks along religious lines, looking at it simply as a battle between Christians and Muslims. This lens ignores the myriad differences in terrorism across regions. “What explains violence in Sri Lanka probably doesn’t explain violence in Paris,” Shaun Casey, director of Georgetown University’s Berkley Center for Religion, Peace and World Affairs, told The Washington Post this week.

Neither the Islamic State nor far-right attackers such as Tarrant can be said to speak for an entire religion, and they don’t claim to.

The Islamic State might consider the Muslims who died in Tarrant’s rampage as “takfir,” a complicated term that indicates excommunication, or a nonbeliever, for living in a Western, Christian-majority country. Though some far-right terrorists have claimed to be motivated by Christianity, Tarrant’s manifesto stated his Christian identity was “complicated.” Instead, his extremist beliefs appear to be tied to racial identity.

But terrorist attacks are not primarily aimed at rallying your peers. They are aimed at terrorizing your enemies, and it’s not surprising that they work. Globally, Muslims and Christians are the victims of violence and persecution, and emphasizing the supposed conflict between the world’s two largest religions often is politically expedient.

I think Islam hates us,” President Trump said before his election. He also suggested all foreign Muslims should be banned from the country (watered-down versions of this ban have been the subject of repeated court cases). After the shootings in Christchurch, Turkish President Recep Tayyip Erdogan played videos of the attack at campaign rallies and pledged to make the perpetrator “pay for it.”

For religious communities on either side, the net result is a vicious cycle. Hilmy Ahamed, vice president of the Muslim Council of Sri Lanka, said the Christchurch attack had some positive effects for Islamic communities. “The New Zealand attack opened the eyes of the world to the crisis the Muslims are facing,” he told CNN.

But Muslims in Sri Lanka are scared. “The Christians have always been brotherly with us, but some other people may want to take revenge, or take advantage, especially in rural areas where people are not protected. So we fear,” Shafi Mula, the manager of a mosque in Colombo, told The Post’s Pamela Constable. “We fear.”

Want smart analysis of the most important news in your inbox every weekday along with other global reads, interesting ideas and opinions to know? Sign up for the Today’s WorldView newsletter.