Extremist insurgents battled for hours on Sunday with African Union troops after exploding a car bomb outside their base.

Al-Shabab militants attacked the African Union (AU) peacekeepers' base in the town of Bulomarer, 130 kilometers northwest of the capital Mogadishu, around 9 a.m. local time.

Since withdrawing from Mogadishu in 2011, the al-Qaeda-linked group has lost control of most of Somalia's cities and towns. But it still retains a strong presence in regions outside Mogadishu.

The militants initially detonated two car bombs that hit one AU vehicle and one Somali military vehicle, Somali army major Farah Osman, who is stationed near the AMISOM (African Union Mission in Somalia) base, said.

"Then a large number of al-Shabab fighters began firing from under the trees ... it was a hellish battle," he said.

Somalia has been mired in civil war since 1991.