Last Thursday, the Somali terrorist organization al-Shabab formalized its relationship with al-Qaeda.

While the two organizations have long benefited from close cooperation, this move confirms al-Shabab’s weakening influence. However, by integrating into a more sophisticated terrorist network, al-Shabab is also demonstrating its ability to adapt to evolving challenges. As the Obama Administration grapples with developing a comprehensive counterterrorism strategy, it should consider the resourcefulness of terrorist organizations to use their external networks.

While al-Qaeda and al-Shabab share similar ideologies, they maintain different interests that preclude them from being natural allies. Al-Shabab’s objective for the annexation of a greater Somalia is more modest than al-Qaeda’s goal of establishing a global caliphate. Al-Qaeda has also had historical difficulties operating in Somalia. In 1992, when Osama bin Laden sought to expand the al-Qaeda network, Somalia’s complicated clan dynamics, its high operating costs, and its population’s suspicion of outsiders prevented al-Qaeda from establishing a permanent branch.

As a result, al-Qaeda limited its activities in Somalia to recruiting and frequent use as a safe haven. When al-Shabab emerged in 2006, al-Qaeda used this opportunity to expand its network, providing the fledging terror group with arms, funding, and training. However, it wasn’t until 2008 that the United States designated al-Shabab a foreign terrorist organization.

Despite territorial claims to nearly all south and central Somalia, in the past 18 months al-Shabab has suffered internal divisions, tactical errors, and low levels of popular support, forcing it to reassess its viability as an independent organization. In August, Shabab militants unexpectedly withdrew from Mogadishu and vowed to wage asymmetrical attacks against the Transitional Federal Government (TFG) and African Union peacekeepers (AMISOM). While al-Shabab followed through on this promise, its operations were severely disrupted by a Kenyan incursion last November, attacks by Ethiopian forces, and an increased level of AMISOM troops.

By allying itself with al-Qaeda, al-Shabab hopes to revive its insurgency against the TFG. Just as Somalia’s neighbors and countries that are contributing to AMISOM have escalated their attacks against al-Shabab, the Somali terrorist organization is responding with the backing of al-Qaeda.