Dozens of people are feared dead and 30 more are in hospital following an explosion near a popular restaurant in Somalia.

A car packed with explosives rammed into the Mogadishu venue in what police suspect was a suicide attack by a local extremist group.

Al-Shabaab members often targets the country’s capital with bombings. The group is linked to al-Qaeda.

Luul Yamani restaurant, which was also attacked last year, was packed with diners when the driver sped towards it on Friday night (local time).

At least one building near the restaurant collapsed after the blast, and people were feared to be trapped in the rubble.

“I was going to the restaurant but ran back when the blast shook and covered the area with smoke,” resident Ahmed Abdullahi, who lives near the site, told Reuters news agency.

Security in Mogadishu had been especially heavy, with thousands of government forces deployed in anticipation of a planned demonstration on Saturday by an alliance of opposition leaders over the country’s delayed national election.

The demonstration was later postponed.

-with AAP