Progress finally appears to be taking root in “the world’s most failed state,” Somalia. Free elections have brought a reformer to power and Islamists militants are being pushed back. After years of violence and destruction, victimization by armed gangs and a crumbling government, positive steps forward are being taken. The threat of a terrorist safe haven in East Africa has also motivated other African neighbors to take decisive steps to address these challenges before the instability is exported into their own cities and villages.The particularly stark misery in Somalia over the past decade was compounded by its relentlessness. Despite the rising and falling fortunes of various factions and their warlords, the suffering of Somalis has continued. Mogadishu, the capital of Somalia, was eventually reduced to a jaw-dropping example of what years of street-to-street, house-by-house fighting can do to a city. A recurring cycle of destruction has made the capital unrecognizable.Recent events in an outlying provincial city involving a group of Islamist militants known as al-Shabaab, who are linked with al Qaida, demonstrate the complexities currently facing Somalia as it wrestles with its history of rampant lawlessness.The writer is a commentator who divides his time between the United Kingdom and Southern California. He has appeared on CNN, CNBC, BBC and Sky News, and has been featured in The New York Times, The Wall Street Journal, The Washington Post, The Financial Times and The Economist.A few weeks ago, al-Shabaab were driven from the port city of Kismayo after four years in power. During their reign of fear and terror, the city’s Liberty Square was turned into a venue for executions, stoning and floggings. The groups stated goal is the establishment of a Shariah state in East Africa. After several recent setbacks, Kismayo represented the militants’ last major position, having been driven from Mogadishu a year ago by an army under the direction of the African Union, comprising troops from Uganda and Burundi.Due to a coordinated attack codenamed Project Sledgehammer that was led by Kenyan troops, and assisted by the Somali army and a local militia backed by Kenya, al-Shabaab soon realized that their days in control of Kismayo were over. Kenya’s involvement in the domestic security of Somalia is driven by the simple fact that Kismayo sits on the coast of the Indian Ocean, a mere one hundred miles from their border. When Kenyan troops secured the surrounding areas, Somali soldiers were given the honor of retaking the town itself.The hope of the Somali government is that al-Shabaab will soon fall apart. Now that they have finally been driven from Kismayo, their finances have taken a hit since they earned their money from the city's trade. Estimates have the militants earning as much as $50 million a year from Kismayo. However, reports quickly emerged that most of the militants left the city without putting up significant resistance, leaving open the possibility that they may soon regroup and return.In order to deny al-Shabaab a source of much needed revenue, the United Nations had been forced to impose an embargo on, of all things, charcoal, which is a key export from Kismayo. The ban on charcoal exports had inevitable side effects, as embargos normally do. The key staples of life that is imported into the city, such as food and cooking oil, have become even more expensive. City leaders now hope that the embargo will be quickly lifted and that the economy can creak back into motion once again. But the exit of al-Shabaab now means that other factions and their warlords are circling Kismayo waiting to claim the prize. Despite the joy that many Kismayo residents must feel at the departure of the militants, there must be equal amounts of fear and uncertainty over what the future will bring. With Kenyan troops still in the country after their initial invasion last year, the ultimate resolution of the situation in Kismayo will neither be simple nor quick.Somalis recently saw the election of a new president, Shaeikh Hassan Mohamud, which has been a great source of optimism and pride for the country, even though Mohamud’s inauguration was marred by suicide bombers who killed 19 people. In the first election for over two decades, Mohamud, a university professor, surprised critics by winning the final run-off vote. Many hope that his victory represents a meaningful step on the path of stability and prosperity.The West cannot be indifferent about Somalia’s fate, and must keep peace in the region as a high priority. Pirate activity remains a threat in the waters of the Indian Ocean off the coast of Somalia, impacting global trade and transport routes. In addition, a safe haven for terrorists in the east of the continent, together with the established safe haven in Mali in West Africa, would potentially open up Americans and American interests to the same types of risks they faced when Osama bin Laden and the Taliban controlled Afghanistan. Failed states give extremists the opportunity to dig in and establish their bases outside the reach of local and international law.Hopefully, President Mohamud’s election and the retreat of al-Shabaab represent a new chapter for the country. The involvement of other African countries in the process of re-establishing stability in Somalia clearly demonstrates how important these threats are to all the nations of East Africa, as well as for the continent as a whole. The West must continue to support and promote these goals, in order to ensure that the ultimate consequences of extremist safe havens do not eventually arrive on our own doorsteps, as well.