BEIRUT (AP) — As Muslims celebrate the end of Ramadan, many are struggling to comprehend a wave of attacks that killed 350 people across several countries during the holy month and raised the question of what drives the militants to ever more spectacular violence.
The high-profile attacks underline the warnings by many experts that the Islamic State group, especially when on the defensive, will metastasize far beyond its theater of operations.
The extremist group has always sought attention and recruits through terrorism, which has proven to be a winning strategy among its disenfranchised and angry followers.
The loss of its key city of Fallujah capped a series of recent setbacks in Iraq, and the group is pushing to project its strength while also diverting attention from its battlefield humiliations.
"ISIS is waging an existential fight," said Fawaz Gerges, a London-based scholar of jihadi groups, using another acronym for the militant group. "The future of the Islamic State is on the line, and it is trying to maximize the cost for its adversaries and also to inspire this particular segment of young men and women who subscribe to its ideology."
If the militants needed to send a message, Ramadan provided a convenient context.
Most Muslims regard the month as a time for introspection, peace and piety, but militants and hard-line clerics have been touting it as an opportunity for jihad, or holy war.
Weeks before Ramadan, IS urged its supporters to strike wherever possible, and those calls appear to have found resonance.
Omar Mateen, who pledged allegiance to IS, killed 49 people at a crowded gay nightclub in Orlando, Florida, on June 12. Militants killed 44 people at Istanbul's main airport on June 28. Young men killed 20 hostages at a Bangladesh restaurant on July 1.
Such violence highlights how attacks can be instantly attached to IS, even when the group does not claim responsibility. It also underscored the increasingly blurred lines in which attacks can be assigned to IS and transformed into a global cause.
The bloodshed also demonstrated the difficulty in neutralizing a threat that often is inspired by the group and not necessarily directed from within it.
Still, many of the attacks appeared to have been careful planned, with targets clearly meant to induce fear and shock.
In Yemen on June 27, there were seven simultaneous attacks in the southern port of Mukalla against security targets, killing 43 people. In one of them, a bomb was hidden in a box of food brought to soldiers at a checkpoint to break their Ramadan fast.
In the Bangladesh violence, witnesses said the attackers tortured some of the victims before killing them for their failure to recite from the Quran.
Baghdad residents hardened by years of war said a July 3 bombing that killed 175 people was like no other in recent memory. They said shoppers were trapped in an inferno of fire that was one of the deadliest single attacks since the 2003 U.S.-led invasion of Iraq.
The wave of violence culminated Monday with triple suicide bombings in Saudi Arabia, including one that killed four security troops near the Prophet's Mosque in the city of Medina, one of Islam's holiest sites. The apparently coordinated attacks suggested the Islamic State group was to blame, although no one claimed responsibility.
The IS group is increasingly on the defensive in Syria and Iraq. Its hold on territory has shrunk after losing key strongholds, including Fallujah.
Beirut-based analyst Ibrahim Bayram said the group's goal is to dispel the notion that it is going to vanish or shrink.
"With such attacks, it is proving that it is still capable of crossing borders and conducting attacks" everywhere, including in the holy sites in Saudi Arabia, he said. That is a key for the group, which seeks to boost its credentials and recruitment.
But the attack in Medina outside the sprawling mosque grounds where the Prophet Muhammad is buried sparked particular disgust. Millions visit the mosque every year as part of their pilgrimage to Mecca. Across social media and on channels used by the Islamic State group, supporters appeared to be grappling to explain the violence, quickly labeled by opponents as an attack on Islam itself.
This could be why there has been no claim of responsibility.
Mohammad Ballout, writing Tuesday in Lebanon's daily As-Safir newspaper, said the attacks aim to be a direct warning to Sunni-led nations that an undeclared IS truce with them may collapse if they don't halt their support for the war on the group.
Gerges said the Medina attack was not surprising because "there are no red lines anymore."
It is also possible the radicals want to goad the U.S.-led coalition arrayed against them to take them on in their strongholds of Raqqa in Syria and Mosul in Iraq.
Those two cities offer the prospect of a bloody, house-to-house fight that many jihadis calculate would be worth losing, because it would cost their enemy so dearly.
Associated Press writer Ali Abdul-Hassan in Baghdad contributed.