MOGADISHU (Reuters) - Somalia’s militant Islamist group al Shabaab has retaken a small town in the center of the country after it was abandoned by government troops, residents said on Saturday.

Fighting broke out in the town of Muqokori, about 300 kilometers north of the capital Mogadishu, late on Friday, almost a month after government troops ousted the insurgents.

“Al Shabaab attacked from various sides. After one hour of fighting, the government forces left and al Shabaab seized control,” Hussein Nur, a local elder, told Reuters by phone.

The militant group claimed that 47 government soldiers had died in the fighting.

“We have their dead bodies,” said Abdiasis Abu Musab, al Shabaab’s military operations spokesman, adding they had captured four vehicles and dozens of weapons.

The military said the insurgents were not in full control. and that soldiers had been withdrawn for strategic reasons.

“There were only a few soldiers there and they left the town for tactical reasons,” Major Abdullahi Aden told Reuters, adding their positions were being reinforced.

Aden did not give details of casualties.

Al Shabaab militants are fighting to topple Somalia’s Western-backed central government and to rule the Horn of Africa country according to a strict interpretation of Islamic sharia law.

The group was ejected from Mogadishu in 2011 and has since been driven from most of its other strongholds across the country.

But it remains a formidable threat, with its fighters frequently carrying out bombings against civilian and military targets in Mogadishu and other towns in Somalia.

Separately, the group also attacked a military base in the semi-autonomous region of Puntland the same day, killing several soldiers.