Last October, four American soldiers, four Nigerien soldiers, and a Nigerien translator were killed in combat on Niger’s border with Mali while looking for the jihadi militant Doundoun Cheffou. For the most part, the fallout concentrated on President Trump’s mangled call with the widow of Sergeant La David Johnson. But the incident also called attention to a dangerous development at multiple levels of US politics. From a small village in rural Niger all the way to the White House, the US military has increasing influence over American foreign policy in Africa.

American Special Forces have been operating in Niger since at least 2013, when President Obama authorized forty troops to aid the French intervention against jihadist groups in Mali. At the time of the Tongo Tongo attack, four years later, there were 800 US soldiers in Niger. The American engagement there remains the second largest on the continent, after Djibouti. Special Forces are stationed around the country and carry out missions against jihadist targets and drug traffickers with their Nigerien counterparts. The US Air Force is building a $110 million drone base that is technically the property of the Nigerien military, although it is paid for and built by the Pentagon, and access for Nigerien soldiers is currently restricted.

A senior Nigerien military commander told me that the American military has an expansionist agenda in the country and constantly pushes for more missions on the ground. According to a Nigerien soldier who participated in the operation on October 4, the American soldiers involved in Tongo Tongo had ignored the advice of their Nigerien colleagues, putting their unit in danger. In Niger, buoyant, proactive, and well-resourced security institutions like the Department of Defense, Africa Command, and Special Operations Forces have led policy at the expense of a demoralized and downgraded State Department.

Defense cooperation between the US and Africa took off after George W. Bush established Africa Command in 2007. Since then, the Command, known as AFRICOM, has established a constellation of American forward-operating bases and runs training programs and exercises with nearly every country on the continent. Under Obama, the use of Special Forces expanded to the point where they are like “a command within a command” in Africa, according to Matthew T. Page, a former diplomat and current associate fellow with the Africa program at the British-based foreign policy institute Chatham House. Special Forces can fund and train foreign elite units under a legal precedent set by Section 1208 of the National Defense Authorization Act for Fiscal Year 2005. By 2017, the 1208 authority budget has swelled to $100 million.

Niger is just one of the many countries around the world in which the US has trained elite military units in the name of counterterrorism. But as Lauren P. Blanchard, an analyst at the Congressional Research Service, told me, “The problem with training elite units is that those forces may be first and foremost in charge of regime protection versus civilian security.” American and host government interests align when jihadist groups are the security priority, but if a government feels that its power is more threatened by democratic protesters, or members of an opposition party, it often employs its special forces in ways the Americans did not envision in their training programs.

For example, the US trained Mali’s elite parachute regiment, known as the red berets, for years in order to fight the growing terrorism problem in the country’s northern regions. Jihadist veterans from Algeria’s civil war had established themselves there throughout the early 2000s, and recruited in the desert areas. But in 2012, lower-ranking soldiers carried out a coup d’état after soldiers in the Kati military camp briefly detained the defense minister, who was visiting them to quell concern over conditions of their colleagues fighting in the north. The soldiers then seized munitions and took control of the presidential palace. The red berets were suddenly out of power, and they launched a counter-coup that failed. In the ensuing violence, almost two dozen red berets were killed. “It was a presidential protection unit and, at the end of the day, [the American training] didn’t professionalize that unit,” said Page. “When this coup attempt happened, half the regiment turned its guns on the other half, killed them and buried them in a mass grave.” In the chaos that followed, jihadist militants took control of the north of the country.

In Burkina Faso, the US worked closely with the Régiment de Sécurité Présidentielle, the feared presidential guard whose chief, Gilbert Diendéré, was also the country’s top intelligence officer. When popular protests forced his boss, former President Blaise Compaoré, to flee the country aboard a French military helicopter in 2014, the government that was then elected began investigating Diendéré and his unit for killing protesters. Diendéré and his soldiers responded by launching a coup, which was eventually put down peacefully by the rest of the military.

A US Army News Service article points to a dilemma faced by soldiers in northern Cameroon, who are stationed there to aid Cameroon’s fight against the militant group Boko Haram. The American soldiers are carrying out a diplomatic role that is not normally within their purview. “With no State Department personnel stationed in the area, soldiers are often placed into a warrior-diplomat role, representing the American government wherever they go.” But even AFRICOM seems worried by the mission creep that inevitably takes place when a solider becomes a “warrior-diplomat.” Posted by AFRICOM to its official website, the article notes that “any misconduct by a soldier could spark controversy and put the nascent relationship between both countries in jeopardy.”

In Cameroon, American Special Forces work closely with the Brigade d’intervention rapide, an elite, Israeli-trained unit that fights Boko Haram. Last year, Amnesty International found that on a small base in Salak, near the border of Nigeria that the American soldiers shared with the B.I.R., at least sixty people “were subjected to water torture, beaten with electric cables and boards, or tied and suspended with ropes, among other abuses.” Some of the B.I.R. soldiers have now been deployed to put down an uprising in Cameroon’s Anglophone region on the border with Nigeria. Reports of human rights abuses in the area are rife, and the Internet has been shut down there for the past year.

Yet, little seems to weaken AFRICOM’s vision of its work as inherently good. “Within US policy circles, or within US training and assistance community, or within the Special Operations community, there are these beliefs in cardinal truths, that US training and engagement makes these units more professional, that we ‘have to do something’ to help them fight terrorism,” said Page, the Chatham House researcher. “This failure to appreciate the consequences of these day-to-day things that we’re doing and what long-term implications they may have… characterizes US foreign policy in the Sahel.”

There is little hope that the US will stop putting heavy emphasis on military solutions in Africa, or, for that matter, elsewhere in the world. Secretary of State Rex Tillerson, who had no prior experience in diplomacy, is essentially charged with taking apart his own agency. State’s budget has been slashed, and Tillerson has overseen the exit of an entire echelon of senior diplomats from the department. In the meantime, Secretary of Defense James Mattis has secured ever more resources for the Defense Department.

Trump’s choice for Senior Africa Director on the National Security Council is Cyril Sartor, who was the Deputy Assistant Director of the CIA for Africa. There has not been a permanent Secretary of State for African Affairs since January 2017, but in December, the Defense Department named Alan Patterson its new Deputy Assistant Secretary for African Affairs. Patterson is another CIA alum, who was previously in charge of clandestine operations in Africa. That former CIA officers occupy two of three leading positions for US engagement in Africa is dismaying. In earlier decades, the CIA was implicated in the assassination of Congo’s independence leader Patrice Lumumba, the coup d’état that overthrew Ghana’s first president, Kwame Nkrumah, and the arrest by the apartheid South African government of Nelson Mandela. More recently, in 2011 the CIA armed rebels fighting Muammar Qaddafi in Libya. The agency’s history of disruptive actions is not a promising backdrop to the general contours of American strategy today on a continent of countries that the US president has labeled “shithole.”

The gap left by the US’s (and, to some extent, Europe’s) lack of economic and political engagement with Africa has led the continent to turn its attention elsewhere for trade and investment. “Essentially, the entire non-military agenda in Africa of Africa’s outside partners has been ceded to China,” said Columbia professor Howard French, author of China’s Second Continent, a study of Chinese involvement in Africa. The lack of engagement is to the detriment of both Africa and the US, he argued.

Abou Tarka, a brigadier general in Niger’s military whose brother-in-law was recently named chief of staff of the country’s armed forces, told me that Niger won’t end up like Yemen, where the US has killed at least 103 civilians, because the relationship between the country’s government and the American military is strong. “The situations are different,” Tarka said. “In Yemen, Americans are belligerent; they don’t cooperate with the government.” A top Nigerien military commander, who spoke on the condition of anonymity because he is not authorized to talk to the press, told me that he doesn’t believe the drones will make mistakes because they are only authorized for use in defensive situations.

But this is the same authorization that the US employs elsewhere for manifestly offensive operations. Jennifer Gibson, a lawyer who researches American drone strikes for the nonprofit group Reprieve, explained: “We’ve seen this malleable definition before, most recently in Yemen and Pakistan, where a program that started as ‘defensive’ wound up striking people simply because their behavior ‘looked’ suspicious. Hundreds of innocent men, women and children were killed as a result.”

I asked a Nigerien civilian who works on the drone base what the forces there think about their mission. “The American soldiers themselves don’t know why they’re here,” she said, but the local population is anxious about whether the US will make the same mistakes in West Africa as they have elsewhere in the world. “The Americans are on a balance,” she said. “It’s up to them as to which way they will tip the scale.”

Trump was elected on a platform that pledged to break with past US interventionism, arguing “we cannot commit American troops to battle without a real and tangible objective.” But the latest iteration of the endless global “war on terror”—this time, as a war in Africa with little civilian oversight, dangerous consequences, and ballooning budgets—undermines that resolve. And while America is making war in Africa and military engagement morphs into a proxy for foreign policy run by the Pentagon, China is doing business.

Reporting for this article was facilitated by a grant from the Pulitzer Center on Crisis Reporting.

An earlier version of this essay misstated Alan Patterson’s government department; it is Defense, not State.