Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The U.S. military conducted an airstrike against al Shabab militants in southern Somalia early Thursday, Pentagon officials said.

A very small group of U.S. military advisers accompanied some Ugandan soldiers during a raid of an illegal taxation checkpoint in rural southern Somalia just west of Mogadishu, Pentagon spokesperson Captain Jeff Davis said.

Armed members of the militant group al-Shabab attend a rally on the outskirts of Mogadishu, Somalia, in 2012. AP file

The U.S. was there in an advise and assist capacity, he said.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

During the raid, the Ugandans came under fire from 15-20 al Shabab militants and the U.S. commander on the ground called in a “defensive” airstrike, killing five militants and wounding two more.

Related: U.S. Launches Strike Against Al-Shabab Leader in Somalia

The U.S. military was “nearby” at the time, Davis said, adding that they did not fire on al Shabab themselves, nor were the Americans ever fired at.

A defense official said that the airstrike was conducted by an MQ-9 Predator drone that was overhead at the time and able to respond very quickly.

Related: U.S. Airstrike in Somalia Kills Scores of Al-Shabab Militants During 'Ceremony'

The U.S. military has about 50 personnel deployed to Somalia now supporting the African Union Mission in Somalia.

This is the second kinetic incident with the U.S. in Somalia this week. The first incident occurred on Tuesday when a small group of U.S. military supported a Somali military mission against a group of al Shabab militants.

The U.S. provided the helicopters and advise and assist for that mission, which one defense official said was also defensive because they had intelligence that the al Shabab fighters were planning an attack on the AMISOM installation nearby. No word on how many al Shabab were killed or wounded in that operation.