At least three people have been killed and seven injured when a suicide bomber blew himself up inside a restaurant in Somalia's capital, Mogadishu, news agency AFP reports.

"The target of the suicide bomber was civilians sitting at the [ Blue Sky] restaurant. He walked [among] them and detonated himself killing three civilians and wounding seven others," Information Ministry spokesman Ismail Mukhtar Omar said.

Witnesses said security forces cordoned off the scene after the blast.

"The blast was very heavy, and I saw people rushed to hospital. Some of them were seriously wounded," Mogadishu resident Kasim Ali told AFP.

No group has so far claimed responsibility for the bombing but al-Shabab, which is affiliated to al-Qaeda, has often conducted similar attacks in the city.