African Union troops and tanks occupied Al-Shabab's former stronghold of Kismayo on Tuesday, but the Somali Islamist militants gave notice of their intention to fight back, saying they detonated a bomb in the port city.
The blast points to the Al-Qaeda-linked rebels' ability to hit back with covert strikes and continues a pattern of attacks in other urban strongholds from where they have retreated under military pressure, including the capital.
A spokesperson for Al-Shabab's military operations, Sheikh Abdiasis Abu Musab, said the bomb was planted inside a district administration office building now housing Somali troops and warned of more attacks.
"This is only an introduction to the forthcoming explosions," he told Reuters. The militants had succeeded in "killing many," Musab said.
The government said the explosion caused no casualties.
Kenyan troops fighting under the AU flag entered Kismayo for the first time on Tuesday after launching an offensive against the port on Friday, forcing the rebels to flee.
They followed hundreds of Somali government troops and allied militia fighters who deployed in the city on Monday.
Al-Shabab's strength is hard to gauge. Mohamud Farah, a spokesperson for Somalia's government forces, said between 4,000-5,000 fighters were hiding in the southern Juba regions.
Hundreds of foreign fighters had joined the insurgency at its peak from countries such as Afghanistan, Pakistan, Kenya, Tanzania as well as the United States and Britain, Somalia's last government said.
"Foreign fighters (also) started leaving when they saw their space was shrinking," a Nairobi-based security adviser said, referring to the offensive by African Union and Somali government troops that has steadily won back rebel-held ground over the past 14 months.
After the surrender of Kismayo, defection rates among foot soldiers were also expected to pick up, with the rebel group seen as a losing proposition.
What will be left behind, analysts say, is a hardline core.
Whether Al-Shabab is able to wage a prolonged campaign of guerrilla attacks on Kismayo will largely hinge on Mogadishu's success in establishing a regional administration that satisfies competing clan interests in the south.
"If you have marginalized clans, Al-Shabab will find allies in them. If all clans are on board it will be hard for al Shabab to infiltrate Kismayo," the security adviser said.
Regional economies at risk
Al-Shabab, which formally merged with Al-Qaeda in February, has been seen as a major threat to stability in east Africa.
The militants warned that although they had withdrawn from Kismayo, the AU offensive had not yet dealt the combat-hardened rebels a knock-out blow and that they would hit back against Kenyan and Ethiopian targets.
"We shall never spare Kenya and Ethiopia even if they withdraw their troops. They are age old enemies of Somalia and we shall fight them be it in their lands or here till the doomsday," Al-Shabab spokesperson Sheikh Ali Mohamud Rage said.
There are likely to be growing fears that the battered militants will look to carry out high profile attacks beyond Somalia's borders, in a bid to reestablish their jihadist credentials.
"It appears that, with the loss of Kismayo, Al-Shabab's days as a quasi-conventional military force occupying and, to an extent, administering territory within Somalia are over," said J. Peter Pham of US think-tank the Atlantic Council.
However, Pham said, Al-Shabab is far from a spent force.
"In fact, freed of the burden of actual governance … the hardline extremists within Al-Shabab are now actually freer to evolve into a true terrorist organization and possibly pose a greater threat not just to Somalia, but to neighboring countries and possibly beyond," Pham said.
The loss of footholds across southern and central Somalia means the hardline remnants of Al-Shabab will not have access to the lucrative rackets that previously financed the group.
Even so, Will Hartley of IHS Jane's said Al-Shabab was capable of an attack similar to the suicide bombings in Kampala that killed 79 people watching the World Cup soccer final in 2010.
"Until they actually lost control of that last territory (Kismayu), Al-Shabab's energies were very much on Somalia," Hartley said.
"Having faced quite a significant setback which has severely damaged their prestige, they may well look to carry out high profile operations that will look to reestablish their reputation."