After more than 20 years without formal relations, the United States officially recognized the government of Somalia Thursday, paving the way for what Secretary of State Hillary Rodham Clinton called “a new chapter” between the two nations.

For the first time since 1991, the country once known as the world’s most failed state has a new president, parliament, prime minister, and constitution, and the tide has turned in its battle against Islamic extremists and pirates.

That progress has been building for several years, but it has accelerated in the last half decade, to the point where the US is now even mulling opening an embassy in Mogadishu, the Somali capital.

“Four years ago, at the start of the Obama administration, Somalia was, in many ways, a different country than it is today,” the Secretary of State told reporters as she formally recognized the government of Somali President Hassan Sheikh Mohamud.

“The people and leaders of Somalia have fought and sacrificed to bring greater stability, security, and peace to their nation.”

Mr. Hassan, who visited Washington for the event, as well as to meet President Barack Obama, praised the “unwavering support to the people of Somalia” from the United States.

“We are looking to the future,” he said. “Somalia is emerging from a very long, difficult period, and we are now moving away from the chaos, instability, extremism, piracy, to an era of peaceful and development.”

False hopes leading to later collapse have been the nature of Somali politics since the last time the US recognized any government in Mogadishu, in 1991.

Then, warlords ousted dictator Mohamed Siad Barre and began the inter-clan warfare that brought Somalia to its knees. There have since been 14 attempts to establish and stabilize a new government. All have failed.

But the Transitional Federal Government (TFG), the temporary administration that preceded President Mohamud’s tenure, managed to unite Mogadishu’s disparate power blocs, thus opening the doors to increased aid, which in turn brought its own benefits.

At the same time, an African Union force that was deployed against the Al Qaeda-allied militant group Al Shabab in Mogadishu has – after a shaky start – managed to push the rebel fighters from almost all of their territory.

At sea, international naval patrols and new policies by ships’ owners to deploy armed guards on their vessels appear to have brought Somalia’s pirates to heel. Last year saw fewer successful hijacks that at any point since 2007.

Little of this progress would have been achieved without the significant support of Somalia’s regional neighbors in East Africa, and from the international community, which feared the country becoming a safe haven for terrorists.

The US has spent more than $1.4 billion on supporting the African Union mission, Somalia’s security forces, emergency aid, and development assistance, and Somali refugees, Secretary Clinton said.

"Today, thanks to the extraordinary partnership between the leaders and people of Somalia with international supporters, Al Shabab has been driven from Mogadishu and every other major city in Somalia," she said.

She stressed that there was still a lot of work facing the country's new leaders, "but they have entered into this important mission with a level of commitment that we find admirable."

President Obama noted “impressive security and political gains in Somalia,” and while “acknowledging the many challenges” the country faces, he “expressed optimism about [its] future," his staff said.

Is that hope unfounded? No, says Andrews Atta-Asamoah, a regional security analyst at the Institute for Security Studies in Pretoria, South Africa.

“Optimism has been, with good reason, in very short supply in Somalia, but I think it is fair now to say that we should allow a little optimism in,” he says.

“There are enormous difficulties, but this is the most progress we’ve seen in beating them for a very long time.”

Despite this upbeat analysis, however, there are still almost daily examples of those difficulties.

International aid agencies do not yet feel confident enough fully to ramp up their operations, leaving millions of people still hungry and beyond the reach of decent schooling or health care.

After two decades of civil war, infrastructure in Somalia is shattered. The economy, while recovering, is shambolic.

And perhaps most importantly, Al Shabab, although far diminished, continues to carry out targeted killings or indiscriminate bombings in Mogadishu, and has threatened to regroup and return.

The group claimed Thursday to have executed a French spy it kidnapped in 2009, after France mounted a failed commando operation to rescue him last weekend. During that mission, 17 Al Shabab fighters and two French soldiers died.

Two aid workers and an American journalist are still held hostage elsewhere in Somalia.

Hassan, standing beside Secretary Clinton as his government was formally recognized, conceded that there were still grave difficulties, but vowed to maintain progress.

Get the Monitor Stories you care about delivered to your inbox. By signing up, you agree to our Privacy Policy

“We are working for a Somalia that is at peace with itself and with its neighbors, where its citizens can go about their daily lives in safety,” he said.

“Instability, violent extremism, and crime in Somalia are a threat not only to Somalia, but to the region and the world at large. We look to the future with hope, pride, and optimism.”