Washington: After an extensive search, a US soldier who had been missing for nearly two days in Niger was found dead, a result of a deadly ambush by dozens of Islamist extremists on a joint patrol of American and Niger forces, US military officials said on Friday.

The soldier, whose name has not been released, was one of four US troops and four Niger forces killed in the attack.

His body was found by Niger soldiers on Friday near where the ambush occurred, and then transferred into US custody at a safer location further from the attack site, said Army Col. Mark Cheadle, spokesperson for US Africa Command. The soldier’s body was then moved onto an American helicopter by US forces in a sombre ceremony and then taken away for formal identification.

Eight Niger soldiers and two US troops were wounded in the attack, but they were evacuated from the area on Wednesday after the attack unfolded. Cheadle said there was no indication the missing soldier was ever taken captive by the enemy forces.

US officials described a chaotic assault in a densely wooded area, as 40-50 extremists in vehicles and on motorcycles fired rocket-propelled grenades and heavy machine guns at the patrol, setting off explosions and shattering windows. The soldiers got out of their trucks, returning fire and calling in support from French helicopters and fighter jets that quickly responded to the scene, according to officials. It’s unclear if the French aircraft were armed or if they fired on the insurgents.

The officials weren’t authorised to discuss the matter publicly and so spoke on condition of anonymity.

US officials say they believe extremists linked to Daesh were responsible for the attack about 200 kilometres north of Niger’s capital, Niamey.

The US and Niger forces were leaving a meeting with tribal leaders when they were ambushed.

Cheadle said there were no armed aircraft overhead as the US and Niger forces went on their mission, but there was surveillance. The meeting with local leaders, he said, had been considered a low-threat mission that wasn’t likely to lead to an encounter with any enemy forces.

He said there were about a dozen US forces accompanying a company of Niger troops, for a total of about 40 service members in the joint mission.

Most of the US troops were army special forces, but the soldier found on Friday was not a Green Beret, other US officials said.

In the frenetic aftermath of the attack, a wide array of forces from the US, Niger and France were tapped to search for the missing soldiers. Cheadle said more than 100 troops either took part in the search or were prepared to join it. It’s not clear if the US sent ground forces in to search, but Niger troops were actively looking for the soldier.

US forces killed in the attack were: Staff Sgt. Bryan C. Black, 35, of Puyallup, Washington, Staff Sgt. Jeremiah W. Johnson, 39, of Springboro, Ohio, and Staff Sgt. Dustin M. Wright, 29, of Lyons, Georgia. All three were members of the 3rd Special Forces Group, based at Fort Bragg, North Carolina.

Wright’s father, Arnold, said his son grew up playing sports with his three brothers and liked to joke around. He followed both his parents and one of his brothers into the army. And his brother, Will, who also served in the military, described his younger brother as “an amazing special forces soldier and an amazing friend.” Will Wright said the two were just 13 months apart, were very close and shared a special bond over their military service.

Cheadle told Pentagon reporters that US Africa Command is still gathering information about the attack, but no formal investigation has been launched. And he added that the US military is absolutely “resolved to go after those who attacked” the troops.

According to a statement by Niger’s army chief of staff, the joint patrol was attacked by “terrorist elements” in a dozen vehicles and riding about 20 motorcycles.

The statement said the deaths and injuries came “after intense fighting, during which elements of the joint force showed exemplary courage.”

US special operations forces have been routinely working with Niger’s forces, helping them to improve their abilities to fight extremists in the region. That effort has increased in recent years, the Pentagon said.

Mali, Mauritania, Niger, Burkina Faso and Chad are putting together a 5,000-strong G5 Sahel force to fight the growing threat from extremists in the vast Sahel region. The first units are expected to deploy in October and all battalions should be on the ground by March 2018.

The Security Council unanimously adopted a resolution in June welcoming the deployment, but at US insistence it did not include any possibility of UN financing for the force.

That force will operate in the region along with a 12,000-strong UN peacekeeping mission in Mali, which has become the deadliest in the world for UN peacekeepers, and France’s 5,000-strong Barkhane military operation, its largest overseas mission.