Fierce gun battle lasts for several hours after attack on military camp in Bulo Marer, 160km southwest of Mogadishu.

Heavily armed al-Shabab fighters have attacked an African Union base southwest of the Somali capital, Mogadishu.

The gunmen on Sunday detonated at least two cars at the military camp in the town of Bulo Marer, before engaging soldiers from African Union Mission in Somalia (AMISOM).

The fighting lasted for several hours, according to residents and military officials.

Mohamud Jimale, a Somali military officer in the town, told local media that the al-Qaeda-linked group suffered heavy losses in the attack and retreated after a long gun battle.

Meanwhile, Abdiaziz Abu Mus’ab, the group’s military spokesman, told Al Jazeera they lost 14 fighters.

“The Mujahideen fighters entered the crusaders’ base and killed at least 59 of them. Our fighters also attacked five other bases,” Mus’ab said.

Residents near the town of Golweyn also reported a vehicle explosion targeting African Union (AU) troops on Sunday morning.

Al-Shabab, which is fighting to overthrow Somalia’s government, routinely targets AU forces stationed in the country.

The group was pushed out of Mogadishu in 2011 by Somali troops backed by AMISOM soldiers.