An American special operations soldier was killed and four U.S. service members were wounded Friday in an "enemy attack", according to U.S. Africa Command.
In a statement, the USA military said on Friday one local soldier was also wounded in the attack that also involved Somali and Kenyan forces.
A coalition comprised of around 800 US, Somalian, and Kenyan forces came under attack by mortar and small-arms fire at around 2:45 p.m. local time, AFRICOM said.
An Al Shabab spokesman told Reuters it had carried out the attack in the coastal town of Kismayo, and claimed a higher death toll.
We "determined the allegations of civilian casualties to be not credible", officials said in a statement.
Earlier this month, al-Shabab claimed it blew up a US military vehicle and also downed a USA surveillance drone near Bosaso in the country's northeast.
The U.S. said a Somali soldier was among the wounded, though witnesses said two Somali soldiers were killed.
President Donald Trump on Friday offered his condolences after the Somalia attack.
A "partner force" service member was also wounded, the statement added.
"My thoughts and prayers are with the families of our serviceman who was killed and his fellow servicemen who were wounded in Somalia", Trump tweeted. They are truly all HEROES.
"The mission's objectives were to clear al-Shabab from contested areas, liberate villages from al-Shabab control and establish a permanent combat outpost created to increase the span of Federal Government of Somalia (FGS) security and governance", it added.
The US said its personnel had provided advice, assistance and aerial surveillance during the mission.
The U.S. troops are in Somalia as part of America's counterterror operations in Africa.
It was the first public announcement of a USA military combat death on the continent since four US service members were killed in a militant ambush in the west African nation of Niger in October.
The death of the US soldier in Somalia was the second in the last two years.
American military officials worry that the group is growing once more, even after losing much of its territory in Somalia in recent years and being targeted by American drone strikes.