There are plenty of positive signs on both the military and political front indicating that Somalia is about to turn a corner after two decades of instability and conflict. But despite recent positivity, the state’s long-term success will ultimately be decided by the new government in Mogadishu.

The successful capture of Kismayo by African Union (AU) and Somali troops this week is a very big deal. The city was not only one of al-Shabab’s last urban strongholds, but its last major source of income as well, as the port in Kismayo has been known to generate considerable revenue for the group from charcoal exports. This week’s events cap off a long running political drama that once cast al-Shabab as a group that controlled much of Somalia throughout 2009 and 2010, such that at one point it was even pounding down the walls that protected a small, besieged AU force guarding the transitional government in Mogadishu. Fast forward two years and the once-mighty extremist group is now in open rout across the country.

Yet the explosion that rocked Kismayo on Tuesday serves as a grim reminder that although al-Shabab may be down, it’s certainly not out. That the group pulled out of Kismayo without a fight suggests that they have learned from some of the bloodier fights for Mogadishu and are serious about rebranding themselves as a guerilla outfit. The bulk of al-Shabab fighters seem to be moving northward towards the mountains of Sanaag, bordering Puntland and Somaliland, with others fleeing towards the thick, inaccessible jungles along the Kenyan border. Though these new territorial bases are more far-flung than before, it’s likely that al-Shabab will maintain a capacity to launch suicide bombings and other asymmetric attacks on government troops stationed in cities throughout Somalia.

Though remarkable, al-Shabab’s decline in the military sphere isn’t the biggest issue here. More important is the group’s plummeting political credibility in the eyes of the Somali public. For the first time in decades, there is a credible semblance of a federal government ruling over a consolidated Mogadishu. After so many years of chaos, destitution, and official corruption, the Somali people seem willing to put their faith in a central government once more. Newly-elected President Hassan Sheikh Mohamud is thus presiding over a rare opportunity to expand and strengthen state power in Somalia.

Not only does President Mohamud have the support of the Somali population, but outside powers as well. Western donor states are willing to put their faith in a Mohamud administration that played no part in the rapacious corruption of the past (studies have shown that 70% of all aid to Somalia over the past 20 years has disappeared into private pockets.) And perhaps more importantly, both the AU and neighboring states have come around on the importance of putting boots on the ground until the Somali government is able to secure its own territory. The power vacuum in Somalia is now being seen as a regional problem that engenders serious security issues for all states involved, whether in the form of destabilizing refugee flows, tourist kidnappings in Kenya or terrorist attacks in Uganda.

But this tangible feeling of hope that has recently descended over Somalia is just that- a feeling. There’s still a long way to go before the country’s war-torn economy gets back to work and the government consolidates state power over what has proven to be one of the most difficult places in the world to rule. If President Mohamud squanders the opportunity and falls into the old ways of corruption and official ineptitude, al-Shabab will surely be waiting in the wings to assert itself as a credible alternative and try to recapture some of the popularity it enjoyed in 2009 and 2010.

There will be a mountain of pressure on President Mohamud as he begins his first term. Externally, Western donors and AU stakeholders will be keeping a careful eye out for any sign that their money and manpower is being thrown down the proverbial well. Internally he’ll need to deal with sparse guerilla attacks from al-Shabab and more Machiavellian attacks from some of the old stalwarts of Somali politics like outgoing President Sheikh Sharif Sheikh Ahmed and former parliamentary speaker Sharif Hassan Sheikh Aden, both of who can mobilize their support bases in the streets if the need arises.