Here’s a look at how al-Qaeda has grown in some key Middle Eastern countries:
The United States went to war against Iraq in 2003, based in part on the assertion – later debunked – that al-Qaeda had ties to dictator Saddam Hussein.
That claim turned out to be a self-fulfilling prophecy.
In victory, the US disbanded the Iraqi army, putting hundreds of thousands of disgruntled men with military training on the street. Many rose up against what was perceived as a foreign invasion, feeding an insurgency that has never stopped. The insurgency gave birth to al-Qaeda in Iraq, a local affiliate that pioneered the use of terrorist attacks on Shiite Muslims, regarded as apostates by Sunni extremists.
In its 2007 “surge”, the US in concert with pro-government Sunni militias, largely defeated al-Qaeda in Iraq. But by 2010, the group was “fundamentally the same” as it had been before the boost in troops, according to General Ray Odierno, the top US commander in Iraq at the time.
The 2011 uprisings in neighbouring Syria gave the group the breathing space it needed. Two years later it emerged as Islamic State in Iraq and Syria, also known as ISIS, and split from al-Qaeda’s central leadership.
It also launched an audacious offensive that saw large swaths of Iraq fall into the hands of the jihadists. Although Islamic State has since lost most of its territory, it remains a threat.
Al-Qaeda was active in Yemen even before September 11. It orchestrated the October 2000 bombing of the US destroyer Cole in the port of Aden. After the World Trade Centre twin tower attacks, Bush hailed Yemen’s then president, Ali Abdullah Saleh, as a vital partner in the US-declared war on terrorism.
Saleh received what he called “limitless” US support to fight the jihadists. He in turn gave the US a free hand to conduct attacks against the group’s operatives, including controversial drone strikes, which began in 2002.
But by January 2009, al-Qaeda in the Arabian Peninsula (known as AQAP) had emerged and was soon considered the group’s most dangerous branch.
Then president Barack Obama unleashed special forces teams to hunt down AQAP operatives. He also ramped up drone strikes, launching roughly 200 from 2009 to 2016, according to a report by the Bureau of Investigative Journalism. President Donald Trump has launched 160.
But the strikes and raids often killed more civilians than militants.
In late 2014, Iranian-backed Shiite Muslim rebels known as Houthis swept in from the country’s north-west to seize the capital, Sanaa. Amid the resulting chaos, AQAP netted a prize: the city of Mukalla, with Yemen’s third-largest port. It became the centrepiece of an al-Qaeda fiefdom.
As early as 2012, Nasser Wuhayshi, AQAP’s self-styled “emir” (commander) and founder, had said the group needed to win people over by “taking care of their daily needs”.
The group rebranded itself as Ansar al-Sharia, or Supporters of Islamic Law, and slowly introduced al-Qaeda’s harsh form of Islamist law and governance.
Under Trump, the United States has largely continued Obama’s policies in Yemen. It has given full support to an air campaign led by Saudi Arabia against the Houthis, despite criticism that the strikes have caused most of the 16,000 civilian casualties in Yemen since the war began.
But even as the US has continued to carry out air strikes and raids against AQAP, the group has positioned itself as a virtual ally, battling the Houthis alongside tribal fighters supported by Saudi Arabia.
The fall of Somalia’s US-backed dictatorship in 1991 led to the rise of the Islamic Courts Union, a collection of clerical organisations that formed a sharia-based judiciary. It gained legitimacy by offering services such as education and healthcare.
Washington, suspecting links to al-Qaeda, supported the union’s enemies, and enlisted the Ethiopian army to crush it, which it did in 2006. In the de facto occupation that followed, the Islamic Courts Union’s radical youth wing, al-Shabab, grew as an independent resistance movement that took over most of Somalia’s central and southern regions.
Despite its unpopular application of fundamentalist Wahhabi doctrine, residents tolerated al-Shabab because it fought the Ethiopians, who have a long-standing enmity with Somalis.
In 2012, al-Shabab was declared as the new al-Qaeda affiliate. The change of status attracted a significant number of foreign fighters, including some from the United States.
The Obama administration’s policy of drone strikes along with support for African Union peacekeeping forces, flushed al-Shabab out of the capital, Mogadishu, in 2011. It lost control of most of Somalia’s towns and cities.
And in September 2014, a US drone strike killed its leader, Ahmed Abdi Godane, also known as Mukhtar Abu Zubeyr.
But the group held sway in rural areas, where its estimated 4000 to 6000 militants make it one of al-Qaeda’s largest franchises. They carry out guerrilla attacks on African Union forces and civilian targets and have launched attacks in others parts of East Africa, including the 2013 attack on the Westgate mall in Nairobi, Kenya.
On December 23, 2011, a car bomb struck a residential neighbourhood of Damascus, Syria, that was home to the State Security Directorate.
The building was all but destroyed. Drivers unfortunate enough to be near the explosion were burnt alive. A second car bomb detonated soon after. All told, 44 people were killed.
That attack marked the debut of the Nusra Front, al-Qaeda’s branch in Syria.
The Syrian government had once given the jihadists passage to Iraq to fight coalition forces there. With the civil war, many had now come to return the favour. Nusra’s battle-hardened fighters delivered dazzling successes to the rebel coalition seeking to overthrow President Bashar al-Assad.
It was so effective that US officials, including former CIA director David Petraeus, suggested arming and deploying the al-Qaeda jihadists to fight their former comrades in Islamic State.
And despite its adherence to a strict Islamist code of behaviour and its imposition of sharia in areas it controlled, the group enjoyed popular support from civilians tired of dealing with rapacious opposition factions more interested in looting than fighting.
It later rebranded itself, publicly cutting ties with al-Qaeda even while retaining some of the group’s top operatives.
The group, now known as the Organisation for the Liberation of Syria, is estimated to have 10,000 to 15,000 fighters, including foreigners from as far afield as Albania and China. It is one of several forces targeted by what Assad calls his counter-terrorism campaign.
Officially, there is no al-Qaeda group in Libya. Its affiliate, the Libyan Islamic Fighting Group, was disbanded in 2011; its members renounced violence but distinguished themselves as relatively disciplined rebels once the revolution against Libyan dictator Muammar Gaddafi kicked off.
Since then, some, such as former group leader Abdel-Hakim Belhaj, who fought with Osama bin Laden in Afghanistan and was the subject of rendition by the US after 2001, have become powerful Islamist leaders, with a significant role in Libya’s chaotic politics.
Others have gone over to Islamic State’s Libyan branch or joined other Islamist groups, including a number that took over the Libyan capital, Tripoli.
But while the US, other Western nations and the United Arab Emirates have focused almost exclusively on dislodging Islamic State from its bastions in the north and north-east, al-Qaeda has enjoyed a resurgence, according to an August report from the United Nations.
The group’s threat in Libya registered with the US only this year. In March, the Pentagon’s Africa Command said it had killed two al-Qaeda militants in a drone strike, including one who was said to be a high-ranking official, Musa Abu Dawud.
It was the first such attack against the group in Libya. More followed, including another in June, in what is thought to be an expanded counter-terrorism campaign in the country.