A car bomb killed a Somali military general and five of his bodyguards in the capital Mogadishu on Sunday, Somali police said.

General Mohamed Roble Jimale Gobanle and his bodyguards were killed when a suicide bomber detonated an explosives-laden vehicle next to the general's car near Somalia's defence ministry compound, said police captain Ali Nur.

General Gobanle was the commander of the Somali army's 3rd Brigade, a combat team fighting the al-Shabab Islamic extremists in southern Somalia.

Al-Shabab claimed responsibility for the attack, according to the group's Andalus radio station.

Al-Shabab, which is allied to al Qaida, has been waging a deadly insurgency across large parts of Somalia and often uses suicide car bomb attacks.