Trained al-Shabaab fighters. File picture: Farah Abdi Warsameh

Bosaso, Somalia - A suicide bomber blew himself up in a military camp in the Somali town of Galkayo on Saturday, killing four officers, officials said, an attack claimed by the al-Qaeda-linked al-Shabaab group.

The dead included a military commander and two colonels, the town's mayor, Hirsi Yusuf Barre, told Reuters.

The camp houses a force made up of soldiers from the country's semi-autonomous regions of Puntland and Galmudug who have been integrated into the federal army under efforts to unite the fractured country.

"The death toll may rise," police officer Abdirahman Haji said.

Al-Shabaab’s military operation spokesman, Abdiasis Abu Musab, said it killed five people in the attack.

Al-Shabaab is fighting to topple Somalia's central government and establish its own rule based on its interpretation of Islamic law.

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