"The U.S. provided advice, assistance and aerial surveillance during the mission", AFRICOM said.
An American special operations soldier has been killed in an attack in Somalia that also wounded four other United States military personnel and one Somali soldier.
Three of the four wounded USA service members were evacuated to receive additional medical treatment, the military said.
Militants affiliated with al-Shabab have threatened to conduct attacks against the United States, and the us military has said the group poses a direct threat to USA interests and allies in the region.
For several years, US special operations troops have been on the front lines in Somalia, advising local troops in a long running campaign against the al-Qaida aligned al-Shabab group.More news: Giuliani: Kim Jong-un 'begged' for summit to take place
More news: World No.1 Halep slides past Muguruza, into third RG final
More news: Facebook made some private posts public for as many as 14M users
Trump approved expanded military operations against al-Shabab in early 2017, leading to an increase in US military personnel to more than 500 and the launch of dozens of drone strikes. The US had pulled out of the country after 1993, when two helicopters were shot down in Mogadishu and bodies of Americans were dragged through the streets.
President Donald Trump shared his condolences in a Twitter message Friday evening. Earlier Friday, the U.S. Africa Command issued a statement in response to allegations that civilians had been killed in a May 9 operation, saying a "thorough review" found the allegations to be "not credible". Al-Shabab has been blamed for the October truck bombing in Mogadishu that killed more than 500 people. Past year there was also an incident in Mali in which two SEAL Team Six operators allegedly murdered a Green Beret on an embassy compound, reportedly over fears that he would expose a money laundering scheme that the SEALs were running.
The mission's objectives were to "clear Shabaab from contested areas, liberate villages from Shabaab control and establish a permanent combat outpost created to increase the span of federal government of Somalia security and governance", Africa Command said.
The stepped up USA campaign in Somalia comes as an global African Union force prepares to withdraw from its military mission in the country.
The group used to control most parts of the country, but since 2010, its fighters have been removed from most major towns and cities.
But it retains a strong presence in regions outside the capital. A Pentagon investigation of the incident produced a highly critical report.