A U.S. Navy SEAL was killed Thursday during an operation in Somalia targeting militants from the al Qaeda-linked al-Shabaab terror group, officials said Friday.

"U.S. forces were conducting an advise and assist mission alongside members of the Somali National Army," the U.S. military's Africa Command (AFRICOM) said in a written statement. It said the operation took place near Barii, about 40 miles west of Mogadishu.

A U.S. official confirmed to CBS News national security correspondent David Martin that the service member who was killed was a Navy SEAL advising Somali troops. The official said the troops were dropped by helicopter outside a village where a local al-Shabaab leader was believed to be located and approached on foot.

Get Breaking News Delivered to Your Inbox

The SEAL was killed in an ensuing firefight, the official said. Two other Americans were wounded.

"Al-Shabaab presents a threat to Americans and American interests," the AFRICOM statement added.

"Al Shabaab's affiliate, al-Qaeda has murdered Americans; radicalizes and recruits terrorists and fighters in the United States; and attempts to conduct and inspire attacks against Americans, our allies and our interests around the world, including here at home."

The U.S. military has carried out airstrikes against al-Shabaab targets in Somalia for years, and a team of U.S. Navy SEALs conducted a daring raid in 2012 to rescue an American woman and a Danish man who had been held by the group for months.

The operation in Somalia comes three months after a U.S. service member was killed in a raid against al Qaeda militants in Yemen.

CBS News' Martin confirmed that raid was also carried out by Navy SEAL Team 6, the unit that became a household name in the U.S. after the raid in Pakistan that killed al Qaeda leader Osama bin Laden.