Somali soldiers walk at Sanguuni military base, about 450 km south of Mogadishu, Somalia, on June 13, 2018. (MOHAMED ABDIWAHAB / AFP)

MOGADISHU – Islamist fighters from al Shabaab on Tuesday stormed a military base in a part of central Somalia they were forced from last year, killing at least seven soldiers, including the base commander, an officer said.

Assailants from the al Qaeda affiliate rammed the base in the village of Hawadley with a suicide car bomb and then opened fire, Captain Aden Nur, a military officer in a nearby town, told Reuters.

The base is located about 60 km (35 miles) north of the capital Mogadishu and was wrested from al Shabaab control in October last year by government forces and allied clan militias

"We repelled al Shaabab. We lost seven soldiers, including our commander," Nur told Reuters.

Al Shabaab claimed responsibility for the attack in a statement, saying it had killed "many apostate soldiers and their commander".

ALSO READ: At least one killed in blasts targeting troops in Somalia

The base is located about 60 km (35 miles) north of the capital Mogadishu and was wrested from al Shabaab control in October last year by government forces and allied clan militias.

The offensive, which began in August, has made significant gains. On Monday, the government announced it had captured Harardhere, an al Shabaab stronghold on the Indian Ocean coast that it had held for a decade.

But as pressure on al Shabaab has grown, its fighters have struck back, stepping up gun and bomb attacks on the military and civilians, including in areas it has been chased from.

The group has been fighting since 2007 to topple Somalia's central government and impose its strict interpretation of Islamic law.

READ MORE: Children dying in Somalia as food catastrophe worsens

The insurgency has contributed to an acute food crisis in Somalia. More than 200,000 Somalis are suffering catastrophic food shortages, with some parts of central Somalia on the brink of famine.