A military vehicle hit a roadside bomb in Somalia's semi-autonomous Puntland region on Sunday, killing at least six soldiers and wounding another eight.

The al-Qaeda-linked group al-Shabab claimed responsibility for the attack, which happened on the outskirts of the region's port city of Bosaso.

Al-Shabab is fighting to topple the Horn of Africa country's Western-backed government and wants to rule the country according to its strict version of Islamic law.

It also wants to drive out of Somalia Africa Union peace keeping force AMISOM that helps defend the country's central government.

Mohamed Ibrahim, a major in Puntland's military, told Reuters news agency the vehicle, a pick-up truck, was from Galgala hills, about 40km southwest of Bosasso.

"Our military pick-up hit a roadside bomb today, six soldiers died, eight others were injured," Ibrahim said, adding two of the wounded were in a serious condition.

Gunmen kill four guards in attack in Somalia's Puntland

Sheikh Abdiasis Abu Musab, al-Shabab's military operations spokesman, said the group carried out the bombing. "We are behind the attack," he said.

Al-Shabab once controlled much of Somalia but in 2011 it was driven out of the capital Mogadishu and has since lost most other former strongholds.

But its fighters remain a formidable threat and constantly carry out bombings against both military and civilian targets in Mogadishu and elsewhere.

Officially called the Puntland State of Somalia, the region in northeastern Somalia declared autonomy 1998. However, it does not seek independence.