After African Union forces took al-Shabaab's main stronghold and financial hub, the strategic Indian Ocean port of Kismayo, Sept. 29, the Islamists dispersed across southern Somalia, splitting up into guerrilla units.
But that's only one of several dangers the battered Horn of Africa country faces, despite the security and political gains made by the United Nations-supported Transitional Federal Government in recent months and the AU peacekeeping force known as Amisom.
The TFG has long been weak and inept, plagued by corruption and the clan rivalries that have made Somalia a failed state and wracked by perennial clan fighting.
It was only advances made against al-Shabaab by the 17,600-person Amisom, backed by U.S. Special Forces and U.S. military aid, in a yearlong offensive that has made the recent gains possible.
Al-Shabaab has undoubtedly stirred unrest among the fractious clans as a new government in Mogadishu struggles to rule.
The Islamists have launched a wide-ranging campaign of hit-and-run attacks, including suicide bombings. These are a specialty of the groups' foreign faction, which includes veterans of jihadist operations in Pakistan, Afghanistan, Iraq and Yemen.
Al-Shabaab groups have even succeeded in taking control of the southern port of Merca, north of Kismayo, as much as anywhere in lawless Somalia can be said to be dominated by any faction.
On Oct. 28, a senior Somalia commander, Gen. Mohamed Ibrahim Farah, was killed in an al-Shabaab ambush in the Lower Shabelle region.
But the greatest danger that Somalia will be plunged back into anarchy comes from one of the TFG's strongest allies -- neighboring Uganda, whose troops comprise about one-third of Amisom's strength.
The government in Kampala has declared it will pull out its troops unless the U.N. Security Council unreservedly withdraws an October accusation that Uganda's aiding rebel forces in the mineral-rich Kivu region of the Democratic Republic of Congo, which has been ravaged by war since 1986.
The Kampala government denies it's providing men and weapons to the M23 rebel movement, which is led by a veteran jungle warlord named Bosco Ntaganda, aka "the Terminator."
He's wanted for war crimes committed during the seemingly endless, multifaceted Congolese conflict by the International Criminal Court.
If Uganda makes good on its threat to pull out from Somalia and other African trouble spots, it will hand al-Shabaab a major victory without firing a shot, one that would unravel all the gains made against the Islamists since 2006.
A unilateral withdrawal would gravely weaken Amisom, which is the only fighting force that has kept the TFG intact and allowed elections in September that produced a new president, political newcomer Hassan Sheik Mohamud.
He narrowly survived a suicide bombing on his third day in office.
"Take the Ugandans away and it's likely the entire fragile edifice will come crumbling down," warned African analyst Simon Allison.
Somalia's own military, poorly equipped and even more poorly led, is a loose coalition of militias more loyal to their various clans than the internationally recognized TFG.
The jihadists have also been behind attacks in neighboring Kenya since Kismayo fell.
Kenya's an Amisom stalwart but its goal in Somalia is setting up an autonomous state of "Jubaland" around Kismayo as a buffer zone between itself and the rest of Somalia.
Oil discoveries in the region could have a lot to do with that, particularly in the months ahead.
The jihadist attacks in Kenya could undermine Nairobi's commitment to Amisom, and without the Kenyans and Ugandan the TFG would be dangerously exposed.
In the latest terrorist strike, five people were killed in a grenade attack Sunday on a bus in the Somali-dominated Eastleigh neighborhood of Nairobi, Kenya's capital.
The attacks in Kenya have intensified since its troops moved into Somalia in late 2011 to join the multi-pronged offensive against al-Shabaab with Ugandan and Ethiopian forces.
Sunday's attack was the fourth in three weeks. In July, masked gunmen attacked two churches in the eastern town of Garissa, killing 17 people.
Uganda's also been hit by bombings in the recent past that killed more than 70 people.