One American special operations soldier was killed and four US service members wounded in an "enemy attack" on Friday in Somalia, the Pentagon said - casualties that are likely to put renewed scrutiny on the nation's counterterror operations in Africa.

It's the first public announcement of a US military combat death on the continent since four American service members were killed in a militant ambush in the west African nation of Niger in October.

President Donald Trump used Twitter to pay tribute on Friday night, offering "thoughts and prayers" to the families of the soldier who was killed and those who were wounded.

US Africa Command said in a statement that US troops with Somali and Kenyan forces came under mortar and small-arms fire in Jubaland, Somalia, at around 2.45 p.m. local time.

One member of the "partner forces" was wounded. One of the wounded U.S. service members received sufficient medical care in the field, and the other three were medically evacuated for additional treatment.

The statement did not identify the attackers but said a larger force of about 800 Somali and Kenyan troops were conducting a multi-day operation against al-Shabaab militants about 350 kilometers (217 miles) southwest of the capital, Mogadishu, when the attack occurred. The operation aimed to clear the Somalia-based extremist group from contested areas. The US provided advice, assistance and aerial surveillance during the mission, the statement said.

Al-Shabab claimed credit for the attack, the SITE Intelligence Group said in a statement on Friday.

The US has about 1,000 special operations personnel in Africa. The last killing of a US service member in Somalia was in May 2017 during an operation about 40 miles (64 kilometers) west of Mogadishu.

The US had pulled out of the Horn of Africa nation after 1993, when two helicopters were shot down in Mogadishu and bodies of Americans were dragged through the streets.

But Trump in early 2017 approved expanded military operations against al-Shabaab, leading to an increase in US military personnel to more than 500 and the launch of dozens of drone strikes. Al-Shabaab has been blamed for the October truck bombing in Mogadishu that killed more than 500 people.

Al-Shabaab, linked to al-Qaeda, seeks to establish an Islamic state in Somalia. It was pushed out of Mogadishu in recent years but continues to control rural areas in the south and central regions. Its fighters continue to attack the bases of a multinational African Union force that remains largely responsible for security as Somalia's fragile central government tries to recover from decades of chaos.

The US military and others have expressed concern about the 21,000-strong AU force's plan to withdraw by 2020 and hand over security responsibilities to Somali forces, saying the local troops are not ready.