The attack began on Thursday evening at around 1800 GMT, when a Shabaab militant in a car blew himself up, causing a huge blast that ripped the front off a major hotel and left several cars in flames on the busy street.

Other fighters then stormed inside a building housing a restaurant, where they were quickly surrounded by police.

Medics pulled five bodies from the wreckage immediately after the explosion, but the recovery of more bodies was blocked for hours by the ensuing fighting.

Sporadic shooting continued until officials finally declared an end to the siege late Friday afternoon.

“Our teams have recovered one more dead body after the operation was over and this makes the overall number of the confirmed dead 20,” Aamin Ambulance director Abdikadir Abdirahman told AFP on Saturday.

At least 112 people were admitted to the city’s three main hospitals, medical sources said.

– ‘Martyrdom-seeking’ attack –

At a press conference, Somali security forces held up photos showing the alleged bodies of four of the attackers.

In a statement posted on a pro-Shabaab website, the militants confirmed that four of their number had been killed, adding that others had managed to escape.

It said the fighters waged a “martyrdom-seeking” operation against a “luxury hotel inhabited by government officials and security service officers”.

Witnesses said the initial car bomb attack occurred as the street was filled with people relaxing after a day at work.

The explosion was so powerful that it tossed several vehicles into the air that then burst into flames.

“The whole area was in flames,” said Abdisamed Mohamed, a witness.

The Shabaab emerged out of the Islamic courts system that once controlled central and southern Somalia. The group is believed to have between 5,000 and 9,000 men.

In 2010, the Shabaab declared its allegiance to Al-Qaeda.

The following year, its fighters were chased out of Mogadishu by the 22,000-strong African Union peace-enforcement mission, AMISOM.

They have since lost many of their strongholds but retain control of large rural swathes of the country and continue to wage a guerrilla war, frequently hitting Mogadishu.