Militants kill 7 in Somalia base attack

Islamist fighters from al-Shabaab have 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 says.

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.

"We repelled al-Shabaab. We lost seven soldiers, including our commander," Nur told Reuters on Tuesday.

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

The base is about 60 kilometres 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.

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.