An aerial view of the front of the US Embassy Compound in Mogadishu, Somalia.

The reestablishment of an embassy in Mogadishu reflects progress in the nation in recent years, the United States said. The US is a major security and aid provider to Somalia.

The United States has reopened its embassy in Mogadishu nearly three decades after Somalia collapsed into civil war.

Ambassador Donald Yamamoto said Wednesday that the reopening reflected progress in the Horn of Africa country in recent years and the partnership between the two countries.

"US Embassy Mogadishu will act to enhance cooperation, advance US national strategic interests, and support our overall security, political, and economic development goals and objectives," Yamamoto said.

US fled chaos

The United States shuttered the embassy and airlifted its ambassador out of the country in January, 1991, when longtime dictator Mohammad Siad Barre was overthrown by clan-based militias, who then fought each other for power.

As the country descended into chaos, famine and war broadcast on American televisions put pressure on then-President George H.W. Bush, who ordered US troops to help with humanitarian shipments.

The humanitarian operation was beset by "mission creep," with the United States getting involved both militarily and politically in the civil war.

The United States finally withdrew after two US Black Hawk helicopters were shot down by rebels in 1993, killing 18 soldiers, whose bodies were dragged through the streets of Mogadishu. Ensuing battles left hundreds of civilians and militia fighters dead.

Deadly but improving

Known often for civil war, starvation, piracy and terrorism, Somalia has long been the poster child of a failed state. But since 2012 the country has slowly begun to emerge from its darkest days, establishing a fragile internationally-backed government.

The United States recognized the new federal government in 2013, but had based its diplomatic mission in Kenya.

Washington has provided military support to the government in its fight against al-Qaida-linked al-Shabab extremists, which regularly carry out attacks on government forces and African Union peacekeepers.

A small number of US special operations soldiers have been in Somalia for years. Regular US drone and airstrikes also target al-Shabab militants.