Mogadishu resident Mohamed Osman was praying nearby and said the shock of the blast hit the walls and roof of his mosque.

When outside he saw destroyed cars, some collapsed houses and body parts in the street.

Osman said he had seen nine bodies at the scene.

Abdikadir Abdirahman, director of the Aamin Ambulance service, put the death toll at eight.

It was not immediately clear who was responsible though such attacks have, in the past, been claimed by the al Qaeda-linked al Shabaab.

It aims to overthrow Somalia's central government and impose a strict interpretation of Islamic law.

The group carries out frequent gun and bomb attacks on security and government targets, as well as civilians.