Police and witnesses said at least eight people were killed and 28 wounded on Tuesday, apparently by a hand grenade, in the capital Mogadishu where Somalia's transitional prime minister was addressing a large crowd.

Gedi, on his first visit to the lawless city in the Horn of Africa country since taking office last year, appeared to want to continue speaking but was immediately whisked away from the site by his security team.

Several thousand Somalis who were attending the speech fled the stadium in panic as the dead and wounded, several of them seriously, were taken to local hospitals, police and witnesses said.

"At least eight of [the 28 wounded] are in very critical condition," said Abdi Hasan, a senior Mogadishu police official.

The explosion occurred as Gedi continued his maiden tour of the capital that began on Friday, in a bid to overcome a bitter dispute over when and where his transitional government should relocate to Somalia from exile in Kenya.

Moments before the blast, Gedi had told the crowd he was willing to drop controversial plans to move the government to the towns of Baidoa and Jowhar if security in Mogadishu was enhanced.

"We will relocate to Mogadishu if security improves," he had said.