Today al-Qaeda-type movements rule a vast area in northern and western Iraq and eastern and northern Syria, several hundred times larger than any territory ever controlled by Osama bin Laden. It is since bin Laden’s death that al-Qaeda affiliates or clones have had their greatest successes, including the capture of Raqqa in the eastern part of Syria, the only provincial capital in that country to fall to the rebels, in March 2013. In January 2014, ISIS took over Fallujah just forty miles west of Baghdad, a city famously besieged and stormed by US Marines ten years earlier. Within a few months they had also captured Mosul and Tikrit. The battle lines may continue to change, but the overall expansion of their power will be difficult to reverse. With their swift and multipronged assault across central and northern Iraq in June 2014, the ISIS militants had superseded al-Qaeda as the most powerful and effective jihadi group in the world.

These developments came as a shock to many in the West, including politicians and specialists whose view of what was happening often seemed outpaced by events. One reason for this was that it was too risky for journalists and outside observers to visit the areas where ISIS was operating, because of the extreme danger of being kidnapped or murdered. “Those who used to protect the foreign media can no longer protect themselves,” one intrepid correspondent told me, explaining why he would not be returning to rebel-held Syria.

This lack of coverage had been convenient for the US and other Western governments because it enabled them to play down the extent to which the “war on terror” had failed so catastrophically in the years since 9/11. This failure is also masked by deceptions and self-deceptions on the part of governments. Speaking at West Point on America’s role in the world on May 28, 2014, President Obama said that the main threat to the US no longer came from al-Qaeda central but from “decentralized al-Qaeda affiliates and extremists, many with agendas focused on the countries where they operate.” He added that “as the Syrian civil war spills across borders, the capacity of battle-hardened extremist groups to come after us only increases.” This was true enough, but Obama’s solution to the danger was, as he put it, “to ramp up support for those in the Syrian opposition who offer the best alternative to terrorists.” By June he was asking Congress for $500 million to train and equip “appropriately vetted” members of the Syrian opposition. It is here that there was a real intention to deceive, because, as Biden was to admit five months later, the Syrian military opposition is dominated by ISIS and by Jabhat al-Nusra, the official al-Qaeda representative, in addition to other extreme jihadi groups. In reality, there is no dividing wall between them and America’s supposedly moderate opposition allies.

An intelligence officer from a Middle Eastern country neighboring Syria told me that ISIS members “say they are always pleased when sophisticated weapons are sent to anti-Assad groups of any kind, because they can always get the arms off them by threats of force or cash payments.” These are not empty boasts. Arms supplied by US allies such as Saudi Arabia and Qatar to anti-Assad forces in Syria have been captured regularly in Iraq. I experienced a small example of the consequences of this inflow of weapons even before the fall of Mosul, when, in the summer of 2014, I tried to book a flight to Baghdad on the same efficient European airline that I had used a year earlier. I was told it had discontinued flights to the Iraqi capital, because it feared that insurgents had obtained shoulder-held anti-aircraft missiles originally supplied to anti-Assad forces in Syria and would use them against commercial aircraft flying into Baghdad International Airport. Western support for the Syrian opposition may have failed to overthrow Assad, but it has been successful in destabilizing Iraq, as Iraqi politicians had long predicted.

The failure of the “war on terror” and the resurgence of al-Qaeda is further explained by a phenomenon which had become apparent within hours of the 9/11 attacks. The first moves from Washington made it clear that the anti-terror war would be waged without any confrontation with Saudi Arabia or Pakistan, two close US allies, despite the fact that without the involvement of these two countries 9/11 was unlikely to have happened. Of the nineteen hijackers that day, fifteen were Saudi. Bin Laden came from the Saudi elite. Subsequent US official documents stress repeatedly that financing for al-Qaeda and jihadi groups came from Saudi Arabia and the Gulf monarchies. As for Pakistan, its army and military service had played a central role since the early 1990s in propelling the Taliban into power in Afghanistan where they hosted bin Laden and al-Qaeda. After a brief hiatus during and after 9/11, Pakistan resumed its support for the Afghan Taliban. Speaking of the central role of Pakistan in backing the Taliban, the late Richard C. Holbrooke, US special representative to Afghanistan and Pakistan, said: “We may be fighting the wrong enemy in the wrong country.”

The importance of Saudi Arabia in the rise and return of al-Qaeda is often misunderstood and understated. Saudi Arabia is influential because its oil and vast wealth make it powerful in the Middle East and beyond. But it is not financial resources alone that make it such an important player. Another factor is its propagating of Wahhabism, the fundamentalist, eighteenth-century version of Islam that imposes sharia law, relegates women to the status of second-class citizens, and regards Shia and Sufi Muslims as non-Muslims to be persecuted along with Christians and Jews.

This religious intolerance and political authoritarianism, which in its readiness to use violence has many similarities with European fascism in the 1930s, is getting worse rather than better. For example, in recent years, a Saudi who set up a liberal website on which clerics could be criticized was sentenced to a thousand lashes and seven years in prison. The ideology of al-Qaeda and ISIS draws a great deal from Wahhabism. Critics of this new trend in Islam from elsewhere in the Muslim world do not survive long; they are forced to flee or are murdered. Denouncing jihadi leaders in Kabul in 2003, an Afghan editor described them as “holy fascists” who were misusing Islam as “an instrument to take over power.” Unsurprisingly, he was accused of insulting Islam and had to leave the country.

A striking development in the Islamic world in recent decades is the way in which Wahhabism is taking over mainstream Sunni Islam. In one country after another Saudi Arabia is putting up the money for the training of preachers and the building of mosques. A result of this is the spread of sectarian strife between Sunni and Shia. The latter find themselves targeted with unprecedented viciousness, from Tunisia to Indonesia. Such sectarianism is not confined to country villages outside Aleppo or in the Punjab; it is poisoning relations between the two sects in every Islamic grouping. A Muslim friend in London told me: “Go through the address books of any Sunni or Shia in Britain and you will find very few names belonging to people outside their own community.”

Even before Mosul, President Obama was coming to realize that al-Qaeda–type groups were far stronger than they had been previously, but his recipe for dealing with them repeats and exacerbates earlier mistakes. “We need partners to fight terrorists alongside us,” he told his audience at West Point. But who are these partners going to be? Saudi Arabia and Qatar were not mentioned by him, since they remain close and active US allies in Syria. Obama instead singled out “Jordan and Lebanon, Turkey and Iraq” as partners to receive aid in “confronting terrorists working across Syria’s borders.”

There is something absurd about this, since the foreign jihadis in Syria and Iraq, the people whom Obama admits are the greatest threat, can only get to these countries because they are able to cross the 510-mile-long Turkish-Syrian border without hindrance from the Turkish authorities. Saudi Arabia, Turkey, and Jordan may now be frightened by the Frankenstein’s monster they have helped to create, but there is little they can do to restrain it. An unspoken purpose of the US insistence that Saudi Arabia, UAE, Qatar, and Bahrain take part or assist in the air strikes on Syria in September was to force them to break their former links with the jihadis in Syria.

There was always something fantastical about the US and its Western allies teaming up with the theocratic Sunni absolute monarchies of Saudi Arabia and the Gulf to spread democracy and enhance human rights in Syria, Iraq, and Libya. The US was a weaker power in the Middle East in 2011 than it had been in 2003, because its armies had failed to achieve their aims in Iraq and Afghanistan. Come the uprisings of 2011, it was the jihadi and Sunni-sectarian, militarized wing of rebel movements that received massive injections of money from the kings and emirs of the Gulf. The secular, nonsectarian opponents of the long-established police states were soon marginalized, reduced to silence, or killed. The international media was very slow to pick up on how the nature of these uprisings had changed, though the Islamists were very open about their sectarian priorities: in Libya, one of the first acts of the triumphant rebels was to call for the legalization of polygamy, which had been banned under the old regime.

ISIS is the child of war. Its members seek to reshape the world around them by acts of violence. The movement’s toxic but potent mix of extreme religious beliefs and military skill is the outcome of the war in Iraq since the US invasion of 2003 and the war in Syria since 2011. Just as the violence in Iraq was ebbing, the war was revived by the Sunni Arabs in Syria. It is the government and media consensus in the West that the civil war in Iraq was reignited by the sectarian policies of Iraqi prime minister Nouri al-Maliki in Baghdad. In reality, it was the war in Syria that destabilized Iraq when jihadi groups like ISIS, then called al-Qaeda in Iraq, found a new battlefield where they could fight and flourish.

It was the US, Europe, and their regional allies in Turkey, Saudi Arabia, Qatar, Kuwait, and United Arab Emirates that created the conditions for the rise of ISIS. They kept the war going in Syria, though it was obvious from 2012 that Assad would not fall. He never controlled less than thirteen out of fourteen Syrian provincial capitals and was backed by Russia, Iran, and Hezbollah. Nevertheless, the only peace terms he was offered at the Geneva II peace talks in January 2014 was to leave power. He was not about to go, and ideal conditions were created for ISIS to prosper. The US and its allies are now trying to turn the Sunni communities in Iraq and Syria against the militants, but this will be difficult to do while these countries are convulsed by war.

The resurgence of al-Qaeda–type groups is not a threat confined to Syria, Iraq, and their near neighbors. What is happening in these countries, combined with the growing dominance of intolerant and exclusive Wahhabite beliefs within the worldwide Sunni community, means that all 1.6 billion Muslims, almost a quarter of the world’s population, will be increasingly affected. It seems unlikely that non-Muslims, including many in the West, will be untouched by the conflict. Today’s resurgent jihadism, having shifted the political terrain in Iraq and Syria, is already having far-reaching effects on global politics, with dire consequences for us all.