3 American deaths highlight US military role in Niger What you need to know about the U.S. military's presence there.

 -- The deaths of three American Army Special Forces soldiers in an ambush in Niger on Wednesday in an attack highlights the little known U.S. military presence in the West African nation.

There are more than 800 U.S. military personnel in Niger helping that nation's military with drone surveillance and training and advising in the counterterrorism fight against Islamic extremist groups in the area.

Most of the American forces work on two bases used to carry out surveillance drone missions. The three Americans killed and two others wounded in Wednesday's ambush were part of the mission to train and advise Nigerien forces.

Here's what you need to know:

Why is the U.S. military in Niger?

U.S. military forces arrived in Niger in early 2013 after the United States and Niger reached an agreement for a small presence of 100 American forces to conduct unarmed drone surveillance operations over neighboring Mali from the Nigerien capital of Niamey.

The program was initially designed to provide French forces in Mali with intelligence for their offensive to retake northern Mali from Islamic extremist groups. Intelligence gathered from the drones was also being shared with the Nigerien military in its operations against the extremist groups operating along the border with Mali.

The number of American forces kept growing as the mission in Niger continued to expand, particularly with the addition of a new drone base in Agadez, in northern Niger. By the end of 2016, the Obama administration told Congress that there were 575 American forces in Niger assisting with the counterterrorism mission there.

The number rises to 800 when the U.S. military personnel assigned to the embassy are factored in.

Army Special Forces units, more commonly known as Green Berets, routinely train and advise Niger's ground forces to increase their counter-terrorism capabilities against Islamic extremist groups in the region. They are not engaged in a combat mission but do go out on joint patrol missions with the Nigerien military as part of their training.

Who carried out the attack?

The three American forces killed in Wednesday's attack were the first U.S. military forces to die in combat in Niger. In February, Warrant Officer 1 Shawn Thomas died from injuries he suffered in a vehicle accident in Niger, becoming the mission's first fatality.

A U.S. official said it was unknown which extremist group targeted the joint U.S.-Nigerien patrol along Niger's border with Mali.

Various extremist groups operate in Mali, including al Qaeda affiliate Ansar Dine, whose seizure of territory in northern Mali in 2012 prompted the French intervention, supported by the U.S. military. Ansar Dine also has a relationship with the broader al Qaeda operation in North Africa known as al Qaeda in the Maghreb (AQIM).

ISIS affiliates Boko Haram and ISIS-West Africa operate mainly in Nigeria, Niger's neighbor to the south, but the groups have also carried out terror attacks inside Niger, Chad and Cameroon. The four countries are known together as the Lake Chad Basin, the name the U.S. military uses for its intelligence, training and support mission in the region to counter those extremist groups.

About 250 American military personnel are in Cameroon conducting a surveillance drone mission similar to that in Niger.