Nairobi - On a Sunday afternoon in late February a car exploded outside a crowded restaurant in Baidoa, Somalia, and moments later a suicide bomber blew himself up among fleeing survivors.
At least 30 people died in the attack, the latest by the Shabaab, a Somali-led al-Qaeda group in East Africa that continues to defy repeated predictions of its demise.
Two days before the Baidoa bombings 14 people were killed when two bombs exploded outside a hotel and a public park in the capital Mogadishu.
One was a 200kg homemade bomb, only the second time Shabaab has used such a large device. The first was in July and the explosion tore the side off a six-storey hotel. Five weeks earlier, 19 were killed in a bomb and gun attack on a restaurant on Mogadishu's Lido Beach.
It is not just civilians who are targeted.
On January 15, Shabaab fighters overran a military outpost in El-Adde, southern Somalia, manned by up to 200 Kenyan soldiers deployed as part of the African Union peace-enforcement mission, Amisom. Kenya has refused to say how many of its soldiers were killed in the attack.
Matt Bryden, director of Sahan Research, a Nairobi-based think tank, described the first such attack, on a Burundian forward operating base in Lego last June, as "a threshold operation". Its success meant that assaults on isolated company-sized Amisom units became their "standard operating procedure".
Amisom's effectiveness is hampered by suspicion and jealousy among the main troop contributing countries and a lack of coordination, funds, focus and will. It is also struggling to adapt to a rural counter-insurgency after its eventual success in urban combat pushed Shebab out of Mogadishu five years ago.
"Amisom is fighting the wrong war," said Stig Jarle Hansen, a Norwegian academic and author of a forthcoming book on jihad in Africa. "Amisom watches their own back, they are in their garrisons, they go out patrolling once a week and the rest of the week the Shebab is on top of things."
By enforcing local support, "Shabaab can survive for 30 years," said Hansen.
The heavy losses inflicted on the Burundians in Lego, the Ugandans in Janale and Kenyans in El-Adde have cowed Amisom, which has retreated from some areas and hunkered down in others. "Since Amisom is not in an offensive posture, Shabaab has plenty of space to think, plan and prepare," said Bryden.
Hitting Amisom makes sense for Shabaab because in the absence of a functioning national army, the 22 000-strong force is the only protector of the internationally-backed government the jihadists are committed to overthrowing.
Similarly, the killing of civilians serves to undermine confidence in the government. "They are attacking signs of normality," said Hansen by shooting up a beachside restaurant, turning a public garden into a slaughter ground or blowing up football fans.
The message is clear, said Cedric Barnes, Horn of Africa director at the International Crisis Group research organisation: "Shabaab is saying, 'There is no normality, no security, it's not Somalia Rising, who are you trying to kid?'"
With a change of government due later this year, the tempo of Shabaab attacks appears to be rising in an effort to undermine the already-shaky legitimacy of the process, said Barnes. The style of attack is also shifting, said Ken Menkhaus, a professor at Davidson College in the US.
"Shabaab is launching more spectacular attacks, looking for maximum bang for its buck," said Menkhaus.
The city attacks also underscore Shabaab's continued infiltration of government areas and the ease with which it can use corruption and sympathetic insiders to subvert security arrangements, moving truck bombs through roadblocks or, as in a botched plot in February placing a laptop bomb on a plane inside an airport that is supposed to be the best-protected place in the country.
The attack itself was a dismal failure with the only casualty being the bomber himself, sucked out of the hole he blew in the side of the plane.
But the intent and ability to get the bomb onboard was new, and worrying.
This week the airport authority in neighbouring Kenya, which has been repeatedly targeted by Shabaab warned of a plot to blow up aircraft, a tactic also attempted by Shabaab's longtime Yemen-based ally al-Qaeda in the Arabian Peninsula (AQAP).
"Has there been a technology transfer from AQAP? That's certainly possible," said Menkhaus.
One of the first moves by Shabaab leader Ahmed Diriye when he took over in 2014 was to reaffirm Shabaab's commitment to al-Qaeda. And, with a recent revolt by internal Islamic State agitators crushed, suggestions that Shabaab might be collaborating with Islamic State's West Africa affiliate Boko Haram are implausible.
Under Diriye the organisation has gained new vigour and expanded its regional reach, confounding hopeful predictions of its end.
"This is a movement whose membership and horizons are broader than Somalia, and is operationally active in at least six countries in the region," said Bryden.
Shebab no longer administers large territories, but has adapted to the new circumstances becoming, "simultaneously weaker and more dangerous," said Menkhaus.
Far from being defeated Shabaab appears reborn.
"It's simply not true that Shabaab is on the backfoot or desperate. They have reorganised, retrained, recruited and found renewed purpose," said Barnes. "To say Shabaab is dying is nonsense, it's just believing your own comms."