Fighters belonging to Somali Islamist militant group al Shabaab stormed an army base near the capital Mogadishu on Sunday, looted it for weapons and then withdrew, a military source, residents and the group told Reuters.

he assault began when a suicide bomber rammed his explosive-laden car into the base in El Salini, 60 kilometres (37 miles) southwest of Mogadishu, at around 5:30 am local time, al Shabaab said.

A local elder, Ahmed Cali, told Reuters he had been woken by the sound of a huge blast followed by gunfire. He said that later al Shabaab fighters were seen leaving the base, some in trucks loaded with ammunition.

A major in the Somali military who didn't want to be named said the military has sustained some casualties, without giving details. He said the army had received reinforcements and was back in control of the base.

Al Shabaab claimed responsibility for the assault and said they had killed 23 soldiers.

"A mujahid driving a suicide car bomb first hit the base and then armed mujahideen stormed the base, we killed 23 military soldiers," said Abdiasis Abu Musab, Al Shabaab's military operations spokesman.

He added the fighters had taken military vehicles and weapons from the base, including anti-aircraft guns.