At least 10 people were killed when two suicide car bombers attacked the local government headquarters in Somalia's Galkayo town in the semi-autonomous Puntland region on Sunday, police said, and the militant al Shabaab group claimed the attack.

"We have confirmed 10 people dead including civilians and security forces," said Ali Ahmed, a police officer.

Witnesses and residents said they heard two loud blasts in quick succession followed by heavy gunfire.

"There were two huge bombs. The first one was a truck bomb, followed a minute or so (later) by another car bomb. My brother was injured at the scene," Halima Ismail, a local resident, told Reuters.

Al Shabaab, which has been carrying out a series of deadly attacks in Somalia, said it was behind the attack.

"There were two suicide car bombs," Abdiasis Abu Musab, the group's spokesman for military operations, told Reuters.