A US service member was killed in Somalia during a firearms attack. Two others were injured in the same incident.

The troops in question were part of the US ‘advise and assist’ mission to the Somali government, which is fighting against militant group Al-Shabaab, US Africa Command reported on Friday.

The incident happened on Thursday near Barii, a town some 60km west of the capital, Mogadishu, the report said.

The command said the mission in Somalia is crucial due to Al-Shabaab’s ties with Al-Qaeda and is aimed at degrading the group’s ability to “recruit, train and plot external terrorist attacks.”

The two injured troops “are both receiving proper medical attention,” Robyn Mack, a spokeswoman at the command told Reuters, refraining from providing details about their condition.

AP cited a Somali intelligence official as saying that the operation involved a helicopter raid on a suspected al-Shabaab hideout near Dare Salaam village. The troops attempted to capture or kill the fighters in the area, but were met with stiff resistance, according to the anonymous source.