Al-Shabaab jihadists attacked an army base in the southern Somali town of Barire on Friday, killing at least 20 soldiers and looting equipment, local sources said.
The assault on the Somali National Army military camp in Barire, around 40 kilometres (25 miles) west of the capital Mogadishu, began with two suicide attackers detonating their car bombs before gunmen overran the base, they said.
"There was heavy casualty and more than 20 soldiers were killed," Abdulahi Haji Mohamed, a traditional elder, said by phone, adding that casualties were taken by helicopter to Mogadishu.
Several other sources gave the same tally, while the Al-Qaeda-aligned Al-Shabaab group claimed it had killed more than 30 troops.
The Somali government did not comment officially on the attack.
Residents said soldiers' bodies were left scattered on the ground while Al-Shabaab fighters looted the base, stealing vehicles and weapons.
Another resident described hearing two large blasts followed by heavy gunfire.
"This attack was very sophisticated with the militants raiding the base from three directions, there were two huge blasts, presumably suicide bombs," said Mohamed Malim.
SNA forces had only recently established the military outpost at Barire after taking control of the town in August with the help of African Union troops.
The Islamist Al-Shabaab have been fighting to overthrow the internationally backed government in Somalia since 2007.
They have repeatedly attacked civilian and military targets with gunmen and suicide bombers.