The U.S. military said its special forces provided advice, assistance and aerial surveillance during the mission.
The incident is the first known death of a USA servicemen in Africa since the ambush in Niger last October.
"During an operation June 8, 2018, in Jubaland, Somalia, one U.S. Special Operations member was killed and four U.S. service members and one partner force was wounded as the result of an enemy attack", according to an Africom statement.
The October attack in Niger raised questions in Washington about the US military presence across Africa as the Trump administration focuses counterterrorism efforts on a range of groups linked to al-Qaida and the Islamic State group.
Kenyan Defense Force (KDF) and USA forces were conducting a joint operation in the city of Jubaland when they came under mortar and small-arms fire.More news: Twitter reacts to news of Anthony Bourdain’s death
The death of the US soldier in Somalia was the second in the last two years.
The attack occurred at an outpost 60 miles northwest of Kismayo of combined American, Somali and Kenyan forces.
The death is the first USA combat death in Africa since an ambush previous year by ISIS-aligned fighters in Niger left four US soldiers dead and prompted questions over whether American troops in the region had proper support.
Al Shabaab is also fighting to drive out African Union mandated peace keeping force AMISOM.
But U.S. military officials said this week that no decision had been made.More news: Liverpool want Nabil Fekir deal done before World Cup
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.
"We killed 40 Somali soldiers in the base", Abdiasis Abu Musab, al Shabaab's military operations spokesman, told Reuters.
A statement from U.S. Africa Command indicated the U.S., Kenyan and Somali forces attacked Friday had planned for the mission carefully.
"Our strategy in East Africa is to build partner capacity to ensure that violent extremist organizations, who wish harm in the region, wish harm on the European continent, and ultimately wish to harm the United States, are contained", General Thomas Waldhauser, Commander, U.S. Africa Command, said in a statement Saturday.
The population in the region had historically supported the government, and the Somali forces had prepared for this mission by coordinating heavily with and securing the support of local authorities ahead of time, officials said.More news: Zverev's condition key to Thiem clash in Paris