Islamist al-Shabaab militants. (File picture: AFP)

Mogadishu - At least 11 people were killed in separate al-Shabaab attacks in Somalia on Friday, officials said, as President Mohamed Abdullahi Farmajo was in Uganda trying to ramp up African Union support for the unstable country's security efforts.

Al-Shabaab militants attacked an army post in Afgoye about 30 kilometres outside Mogadishu, killing six people, including three soldiers, police said.

"A suicide car bomber rammed into the base, killing three soldiers and three civilians and wounding several others," said senior Somali police official Mahad Yare.

Separately, heavily armed militants dressed in army uniforms attacked neighbourhoods in the Bal'ad district, local police officer Ahmed Nor said.

Three local police officers and two civilians died that attack, along with seven of the militants.

The militants were able to briefly seize government offices there and also released a number of prisoners from the district jail, said one local elder, who asked not to be named.

The toll from both attacks, which were claimed by al-Shabaab on its Radio Andalus, could rise.

"Our brave fighters have inflicted heavy casualties on the so-called Somali army stationed in Bal'ad and Afgoye," the group said.

Al-Shabaab, which is seeking to establish an Islamist state in Somalia, regularly launches attacks on government buildings, hotels and restaurants in the volatile nation on the Horn of Africa.

In October, more than 500 people were killed when a suicide bomber detonated a truck full of explosives in the capital.

On Friday, five policemen in neighbouring Kenya were also killed in a suspected al-Shabaab attack.