Iraqi officials have declared that Islamic State’s caliphate is finished. On June 29, after months of urban warfare and U.S. air strikes, Iraqi forces say they are on the verge of expelling the militants from their last holdouts in Mosul. “Their fictitious state has fallen,” an Iraqi general told state TV after troops captured a symbolically important mosque in Mosul’s old city. In Syria, U.S.-backed rebels are moving quickly through the eastern city of Raqqa, another capital of the self-proclaimed caliphate.

Slideshow ( 2 images )

With the imminent fall of the last two urban centers under Islamic State’s control in Syria and Iraq, the group has now lost much of its territory. On June 21, the militants destroyed the historic Grand Mosque of al-Nuri, where three years ago, as Islamic State swept across northern Iraq, the group’s leader, Abu Bakr al-Baghdadi, declared a caliphate at Friday prayers.

The ruined mosque’s capture by Iraqi forces marks the most public symbol of the caliphate’s fall, but it does not mean the end of Islamic State or its reign of violence. The severe loss of territory in Syria and Iraq means that routes for foreign jihadists to reach the self-declared caliphate have contracted. But the group still has the capability to attract recruits, secure weapons, raise funds through theft and extortion, and dispatch sympathizers to carry out attacks abroad. As it gets weaker on the ground, Islamic State has less to lose by unleashing attacks outside of Syria and Iraq.

In recent months, the jihadist group has quickly claimed responsibility for a spate of attacks on civilians in Europe, especially in Britain and France. On March 22, a driver mowed down pedestrians on Westminster Bridge in London, killing five people before being shot by security forces as he tried to break into Parliament. Two months later, a suicide bomber killed 22 in an attack on a concert arena in Manchester. And on June 3, three assailants sped across London Bridge in a white van, ramming into pedestrians. They then emerged from the van with hunting knives and began stabbing people in nearby Borough Market. The attackers killed eight people and wounded dozens before police shot them.

MORE FROM REUTERS COMMENTARY

Bennett Ramberg: How to stop Kim Jong Un using his nukes

Judy Lubin: The biggest victims of the Senate health bill (and other Trump plans)

Islamic State has already adjusted to the imminent loss of its physical caliphate in Syria and Iraq, and to the potential loss of its top leaders. In mid-June, Russian officials said they believed that they had killed Baghdadi in an airstrike that targeted a gathering of senior jihadists outside Raqqa. On July 11, the Syrian Observatory told Reuters it had "confirmed information" that Baghdadi was dead. The claims have not been confirmed, and Baghdadi was erroneously reported killed in the past. But continued fighting and new attacks underscore that the group must have contingency plans in place to deal with the loss of its senior leadership.

Indeed, it’s clear that Islamic State is already adopting the methods of a “leaderless jihad,” a strategy that al Qaeda tried to use with less success. For more than a year, Islamic State has inspired “lone wolf” attackers to act in its name, especially in the West. These radicalized individuals are heeding the call of Islamic State leaders to use whatever methods they have at their disposal - trucks, cars, knives and axes - to carry out attacks that amplify the group’s reach. While Islamic State has organized assaults that required months of training and planning - such as the coordinated November 2015 attacks in central Paris, which killed 130 people - it has moved steadily toward inspiring loosely coordinated and sometimes haphazard attacks by self-radicalized perpetrators.

These attacks allow Islamic State’s leaders to create an illusion of strength to make up for their battlefield losses. They also signal that the group would revert to its roots as a jihadist insurgency, bent on large and small-scale attacks that instill fear but do little to help the militants keep control of territory in Syria and Iraq.

That’s not to say the loss of territory hasn’t weakened the group and caused some of its operations to fail. On June 19, a 31-year-old man rammed into a French police van on the Champs-Elysees in Paris with an improvised car bomb. The explosives failed to denote and the assailant was killed. A day later, a Moroccan national tried unsuccessfully to set off a suitcase bomb packed with nails and gas canisters inside the central train station in Brussels. Security forces killed the man.

During the Muslim holy month of Ramadan in 2016, Islamic State urged its sympathizers to carry out a spate of bombings, mass shootings and stabbings across Europe, the Middle East and Asia. While the group called for a similar campaign during Ramadan this year, which ended on June 25, there were far fewer successful attacks.

Despite the amateurish nature of some recent attempts, cadres of militants who trained and fought with Islamic State in Iraq and Syria have returned to Europe and are now able to train and radicalize others. “Several dozen people directed by [Islamic State] may be currently present in Europe with a capability to commit terrorist attacks,” the European Union’s law enforcement agency, Europol, warned in a report released in December. It added that the group “has proven to be very effective in inspiring people to commit terrorist acts and in setting attacks in motion themselves.”

Islamic State’s leaders realize that they are losing their “capitals” in Mosul and Raqqa. That means the group has squandered the caliphate that distinguished it from other jihadist movements, and helped it dominate headlines and attract new recruits. By relying on lone wolf attacks by individuals who are self-radicalized – and, in some cases, are mentally unstable – Islamic State is able to project a greater reach than it actually has. And it can continue to spread fear, even as its caliphate crumbles.

(Mohamad Bazzi is a journalism professor at New York University and former Middle East bureau chief at Newsday. He is writing a book on the proxy wars between Saudi Arabia and Iran. @BazziNYU)

Editor’s note: This column has been updated to include July 11 reports that Baghdadi was dead.