An army base in southern Somalia was struck by car bombs and gunfire on Wednesday, a military official and witnesses said, in an attack claimed by the Al-Shabaab militant group.
The attack in Awdheegle, about 70 kilometres south of the capital Mogadishu, also killed a Somali reporter embedded with the army, a journalist federation said.
General Yusuf Rageh, commander of the Somali infantry regiments, said the assailants struck with vehicle bombs before gunmen surged forward.
"After the blasts they tried to attack the army defences but were defeated. We are still pursuing them. Some soldiers sustained minor injuries from blast shrapnel but nothing major," he told reporters in Awdheegle.
The Shabaab, a jihadist group that controls swathes of Somali countryside, claimed responsibility for the attack, saying they launched two car bombs and "killed many soldiers".
It is not unusual for the government and the Shabaab to offer differing accounts of casualties from attacks.
Somali security forces and troops from the African Union peacekeeping mission in Somalia (AMISOM) had only retaken Awdheegle, in the Lower Shabelle district, from the Al-Qaeda-linked militants last week.
Witnesses in Awdheegle they heard blasts and heavy gunfire.
"The first blast struck the main entrance of the base, and the second followed a few minutes later. They were huge explosions," said Muktar Dinle, who spoke to AFP by phone.
Another resident, Mohamed Isak, said the firefight lasted more than a hour after the initial explosions.
"We are still trapped inside our houses, and we don't know who is exactly in control of the situation," he said by phone.
A journalist embedded with the army also died in circumstances that remain unclear, the Federation of Somali Journalists said. 
Gacal Abdulle Gacal, 23, was working with the army's radio channel and is the third journalist to be killed in Somalia this year, the federation said.
"We condemn radio journalist Gacal's murder in the strongest terms as it is a serious press freedom violation. We demand an investigation how the journalist is killed," the federation's president, Abdadir Abdulkadir Elmi, said in a statement.
The attack is the latest in a long line of bombing and assaults claimed by the Shabaab, which has fought for more than a decade to topple the Somali government.
The army, which relies on AMISOM forces for military support, is regularly targeted in attacks. 
In January, heavily-armed jihadists overran a military camp on the outskirts of Kismayo in the country's south, killing at least eight soldiers.