Al-Shabab, Mogadishu, Somalia, June 21, 2015
A Somali soldier stands guard next to a site where al-Shabab militants carried out a suicide attack on a military intelligence base in Mogadishu, June 21, 2015. Mohamed Abdiwahab/AFP/Getty Images

Al-Shabab and government forces battled for control of a remote army base in Somalia on Friday, after fighters from the Islamist militant group said they attacked the compound, killing dozens of soldiers.

The group, which is aligned with al Qaeda, said it took over the base, about 340 miles west of Mogadishu after a suicide bomber from the group rammed its gates. It said it was also in control of the small town of Ceel Cado nearby.

It said it killed 61 Kenyan soldiers serving as part of the African Union forces, while other soldiers escaped. The claim could not be independently verified.

In the past, al-Shabab has inflated casualty figures while Kenyan government officials have played them down.

A spokesman for Kenya's Defence Forces (KDF) said al-Shabab fighters overran a Somalia National Army camp situated close to a second camp run by Kenya Defence forces.

"(Kenyan) troops under (African Union auspices) counter-attacked ... The fighting is still going on ...and the number of casualties on both sides is unknown," Col. David Obonyo, KDF spokesman, said in a statement.

'WE HAVE CAPTURED THE TOWN'

Al-Shabab said it was in control of Ceel Cado and had captured nearly 30 lorries, tanks and armored vehicles.

"We have now counted and gathered in the base 61 dead bodies of (Kenyan) soldiers," Sheikh Abdiasis Abu Musab, al-Shabab’s military operations spokesman, told Reuters. "The entire town and the base are in our hands."

African Union troops, comprising about 22,000 soldiers from several African nations, have spent nearly a decade battling al-Shabab insurgents in Somalia, a country mired in conflict since civil war broke out in 1991.

Al-Shabab has in the past year staged multiple attacks against African Union bases in Somalia, part of a guerrilla-warfare strategy to drive out foreign troops and impose its harsh version of Islamic law across the Horn of Africa nation.

A shopkeeper in the town said soldiers from the African Union force, known as AMISOM, appeared to have left the town.

"We see al Shabaab in every corner of town," shopkeeper Abdullahi Iidle told Reuters. "Some residents have fled."

A Somali military official confirmed the militants had taken over the base. He said Kenyan troops and about a dozen Somali soldiers were stationed inside the AU compound.

"AMISOM has gone out of the town and base for strategic reasons," Colonel Farah Surow, a senior military officer stationed about 100 km (60 miles) from the Ceel Cado base, told Reuters.