WASHINGTON (Reuters) - A U.S. commando was killed and four others were wounded on Friday when they came under fire in Somalia during an operation against al-Shabaab militants, the U.S. military said.

The U.S. special operations forces were fighting alongside about 800 troops from the Somali National Security Forces and Kenyan Defense Forces when they were attacked about 2:45 p.m. by mortars and small arms fire.

One local soldier was also wounded in the attack, the U.S. military said in a statement, without clarifying whether that fighter was part of the Somali or Kenyan armed forces.

Although one of the wounded Americans did not receive additional care after being treated in the field, the other three and the wounded local soldier were medically evacuated for follow-up care.

The troops had been on a mission to clear al-Shabaab from contested areas as well as villages the militants controlled, “and establish a permanent combat outpost” to expand the reach of the Somali state, the U.S. military’s Africa Command said in a statement.

“The U.S. provided advice, assistance and aerial surveillance during the mission,” it said.

About 500 U.S. troops are deployed in Somalia.

Al-Shabaab is fighting to overthrow Somalia’s central government and establish its own rule based on its interpretation of Islamic law.

Since being pushed out of Mogadishu in 2011, the group has lost control of most of Somalia’s cities and towns, but it retains a strong presence in regions outside the capital.