Somali security officers gather at the scene of blasts in Mogadishu, Somalia, on Saturday. The attack by Somali militants killed at least 15 people. (EPA)

Militants set off two large explosions Saturday at a popular restaurant in the Somali capital, Mogadishu, killing at least 15 people and wounding about two dozen, according to Somali and U.N. officials.

The attack underscored the fragility of Somalia’s political environment, even as both the United States and the Somali government have sought to portray the Horn of Africa nation as having entered a new, more stable era after more than two decades of chaos and lawlessness.

The blasts ripped off much of the roof of the Village restaurant — an eatery frequented by government employees, journalists and students and about a half mile from the presidential palace and the National Theatre — according to news reports. Local media said a car bomb detonated first, and as people gathered at the scene, a suicide bomber then blew himself up.

“They attack the restaurants because they hate to see people peacefully spending time together,” Mohamed Abdi, an Interior Ministry employee at the scene of the attack, told the Associated Press. “They are committed to obliterating any sign of peace. Because of such attacks, it’s very hard for the government to restore security in the near future.”

Somalia’s al-Qaeda-linked al-Shabab militia, which has waged a deadly insurgency even after being pushed out of Mogadishu in 2011 by African Union forces, asserted responsibility for the attack.

“Government officials, military forces, workers and their security always meet here,” an al-Shabab spokesman, Sheikh Abdiasis Abu Musab, told Reuters. “We had targeted it even before today, and we shall continue targeting it.”

Once a ghostly capital marked by front lines and no-go zones, Mogadishu is now experiencing an economic renaissance. With the help of millions of dollars flowing from the Somali diaspora, new restaurants, hotels and other businesses have opened up. Streets are lighted; residents frequent nearby beaches. Domestic and international flights have expanded. Yet security remains a major concern.

“I am appalled by this act of savagery and condemn it in the strongest terms,” Nicholas Kay, the U.N. secretary general’s special representative for Somalia, said in a statement. “Such cruel and cowardly acts of terrorism serve to remind us that the people of Somalia desperately need peace. Terrorism is a threat to Somalis, the people of the region and the world. It needs to be defeated militarily and politically.”

The assault came a day after Twitter shuttered the main Twitter handle of al-Shabab for the second time this year after the militia tweeted that it would try again to kill Somali President Hassan Sheik Mohamud. Last week, the militia claimed a failed assassination attempt against Mohamud. In January, Twitter closed the militia’s previous account after it threatened to kill Kenyan hostages.

The attack, in one of the most secure areas of Mogadishu, further highlighted the audacity of the militants. In September 2012, two suicide bombers targeted the Village restaurant, owned by a Somali British businessman, in an attack that killed at least 14 people, including several journalists.

Since the overthrow of President Mohamed Siad Barre in 1991, clans, warlords, Islamist militants and Somalia’s neighbors have battled for control of territory and influence. In 1993, mobs killed U.S. soldiers during a U.N. peacekeeping mission, later depicted in the book and movie “Black Hawk Down.” Successive transitional governments were ineffective and accused of widespread corruption.

Mohamud took office a year ago after winning Somalia’s first presidential election of its kind in decades, in a U.N.-backed bid to bring peace and stability. His government has tried to present Somalia as on a track toward stability, despite the continuing security threats from al-Shabab, which still controls large swaths of the countryside in southern and central Somalia. The violence has forced some aid agencies to pull out of Somalia, most notably Doctors Without Borders, which closed all its programs in August after attacks on its staff.