The attacks began on Sunday morning when two car bombs exploded outside the African Union base in the town of Bulo Mareer, 100 miles southwest of Mogadishu, according to Abdifatah Haji Abdulle, the deputy commissioner of Lower Shabelle.
The car bombs destroyed one African Union vehicle and one Somali government vehicle, according to Maj. Farah Osman of the Somali Army, who is stationed near the base.
“Then a large number of Al Shabab fighters began firing from under the trees,” Mr. Osman told Reuters. “It was a hellish battle.”
Newsletter Sign Up
Thank you for subscribing.
An error has occurred. Please try again later.
You are already subscribed to this email.
The Shabab claimed to have killed dozens of peacekeepers in the hourslong firefight, but the group is known to exaggerate such figures.
Mr. Olweny said soldiers in the African Union peacekeeping mission, known as Amisom, had killed 30 Shabab militants during the attacks. The Shabab said only 14 members had died.
Amisom has steadily pushed the Shabab out of major towns, but the group controls large sections of rural territory. It frequently targets Amisom bases and Somali government institutions — attacks that have intensified recently, even as American strikes against the group have increased.
The United States Africa Command, which cooperates with Somalia’s national military and security agencies, carried out nearly three dozen drone strikes against the Shabab last year.
The Amisom peacekeeping force was first deployed in 2007. More than 20,000 soldiers and police officers from six countries serve in the mission, including more than 6,000 from Uganda.
The African Union plans to gradually withdraw its troops from the country and to hand over security operations to the Somali Army by 2020.