This past weekend in the heart of downtown Mogadishu, suspected al-Shabaab terrorists detonated two vehicle-borne improvised explosive devices in the busy K5 neighbourhood, killing over 300 people and wounding hundreds more. It was the deadliest attack in Somalia’s history.

Yet despite an outpouring of global goodwill, was this attack just another sad day in war-torn Somalia? Absolutely not. The reality on the ground is clear: after over two decades of civil war, Somalia is finally re-emerging from the ashes.

So what should policymakers know about the Mogadishu bombing? Two key factors explain the attack and its implications for Somalia and the region: the decline of al-Shabaab and the rising tide of Somali national unity.

First, although al-Shabaab have not yet claimed responsibility for the attack, security experts on the ground insist that the bombing is clearly their handiwork. Yet the fact is, al-Shabaab has systematically lost power across Somalia over the past five years. In 2012, African Union and Somali forces pushed al-Shabaab out of Kismayo, a southern coastal city, causing the terrorist group to lose tens of millions of dollars in revenue from taxing the port. Since then, the group has lost its control over other lucrative land routes, including the strategically significant Afgooye corridor.

“Al-Shabaab are now weak,” explained internationally decorated humanitarian doctor Deqo Mohamed, who runs a clinic in Mogadishu and a hospital along the Afgooye corridor. “They have a small number of checkpoints between Mogadishu and Baidoa, but they’re running out of money, they’re far away [from the key areas], and people are fed up with them.”

Indeed, analysts who have been tracking the group know it is desperate and lashing out, just as it did with the 2013 Westgate Mall terrorist attack in Kenya. “When I was in Mogadishu late last year, it was clear that al-Shabaab was tottering,” said Amarnath Amarasingam, a senior research fellow at the Institute for Strategic Dialogue. “The government’s defection program was gutting levels of trust within the organization and everyday people were totally sick and tired of them.”

Even the scale of the recent attack appears to have been a lucky shot on the part of the alleged al-Shabaab terrorists. Some observers have commented that the reason the blast was so deadly was because the bomb happened to be near to a fuel truck, which unintentionally amplified the explosion. “Somalia’s law enforcement is stretched thin and these kinds of attacks will happen from time to time, but we shouldn’t confuse luck for strength,” said Amarasingam.

Second, since al-Shabaab has been pushed back, the political landscape in is undergoing a remarkable transformation. A crucial moment was the surprising presidential election victory earlier this year of popular Mohamed Abdullahi Mohamed, affectionately nicknamed “Farmaajo” because of his love of cheese. Unlike the many warlords and thugs who have fought over Somalia for the past 20 years, Farmaajo is a technocrat with a demonstrated record of fighting corruption. His unexpected election victory gave Somalis hope that the country was turning a new leaf.