To his credit, President Joe Biden decided to pull American troops out of Afghanistan by September. However, they aren’t out yet. And President Donald Trump’s struggle against his own staff and the military brass demonstrates the power of Washington, D.C.‘s war lobby. If there is conflict anywhere in the world, the latter wants America in it.

Indeed, Trump’s presidency highlighted the breadth and depth of what is commonly called the deep state. He stood almost alone within the Beltway in seeking to end what he knew was a foolish military enterprise. And not just in Afghanistan.

However, he proved unable to halt even one “endless war.” When he conducted a Pentagon purge in his administration’s waning days, outsiders feared a coup attempt. But Trump was merely attempting to fulfill his long-held objective of bringing American troops home. According to Jonathan Swan and Zachary Basu of Axios, “For all the feverish media speculation about the president’s secret agenda at the Pentagon, the ultimate goal was simple: Steamroll the generals and extract America from its foreign engagements, leaving behind a done deal that could not be easily reversed by the next administration.”

Shortly after the November election Trump’s head of personnel, John McEntee, gave marching orders to Douglas Macgregor, recently added as a special advisor to the Pentagon: Get the U.S. out of Afghanistan, Syria, Iraq, and Africa and complete the partial withdrawal from Germany. [editors’ note: Douglas Macgregor is a senior fellow with The American Conservative.] Unfortunately, this was an impossible ask. But it illustrated Trump’s frustration. Especially with the first country on the list, Afghanistan. Trump was no ivory tower theoretician. Instead, in his gut he understood, along with most Americans, that spending almost two decades attempting to build democracy in Central Asia made no sense.

Indeed, in their discussion of the D.C. battle over Afghanistan, Swan and Basu noted that “Trump’s calls to halt the ‘endless wars’ could be traced back to at least 2011, when he was a real estate developer and reality TV celebrity. He’d sent scores of tweets railing against the U.S. military presence in Iraq and Afghanistan while mulling the idea of running for president.” In 2016 he picked up votes in America’s heartland from Americans who feared that President Hillary Clinton would live up to her reputation as the War Queen, a veritable Democratic neoconservative who never met a war that she didn’t want them to fight.

However, becoming president didn’t mean that Trump actually made policy. Wrote Swan and Basu: “Once in office, though, Trump’s ambitions to withdraw from Afghanistan and other countries were subdued, slow-rolled, and detoured by military leaders.” Almost everyone else in Washington seemed determined to fight not just one but several “endless wars” and do so, well, endlessly. Members of the blob, as the permanent foreign policy establishment has been called, appeared to want U.S. troops stationed in every nation on earth.

Thus, the last-minute appointment of Macgregor and ambitious orders for him were essentially Trump’s Hail Mary pass to reverse nearly four years of malicious obstruction by his own employees, such as National Security Advisor H.R. McMaster, as well as the generals who were supposed to carry out his instructions. So Macgregor engineered a direct presidential order for withdrawal, without which there would be no chance of carrying out Trump’s wishes. Thinking they were in control of the policy process, guardians of the deep state were surprised to receive the presidential mandate. Wrote Swan and Basu: “The U.S. government’s top national security leaders soon realized they were dealing with an off-the-books operation by the commander in chief himself.”

Officials could have acted to carry out the president’s wishes. Alas, no. Again, the permanent government mobilized to prevent the elected president from carrying out the people’s will. Swan and Basu related: “News of the memo spread quickly throughout the Pentagon. Top military brass, including Joint Chiefs of Staff Chairman Gen. Mark Milley, were appalled. This was not the way to conduct policy—with no consultation, no input, no process for gaming out consequences or offering alternatives.”

What they really meant, of course, was that the decision was one which they opposed—indeed, had resolutely resisted for years. The Pentagon did not believe that even one of America’s many wars should be ended, apparently ever. Trump’s officials were determined to preserve the conflicts, at least for Joe Biden, and hopefully, in their view, far beyond the latter’s tenure.

As a result, the president’s final effort predictably finished like all of his earlier attempts to force change: dead in the water, which left Biden to decide Afghanistan. In this case, at least, Biden plans to do the right thing. But there still is plenty of time for some of the same actors to sabotage his decision.

Trump challenged the tired interventionist consensus which dominates Washington in other areas, but his appointees undercut him at every turn, consistently promoting their personal positions instead. Swan and Basu reported: “At the Pentagon, [Defense Secretary Mark] Esper had begun losing favor with Trump almost as soon as he was nominated. Even before he was confirmed he offered his full-throated support to the NATO alliance.” Which raised the question, why did Trump nominate Esper?

Swan and Basu also cited Jim Jeffrey, a Never-Trumper who never should have been appointed, as actively subverting the president’s Syria policy. Jeffrey admitted that he misused his position, advancing his views rather than the decisions of the president and interests of the American people. He even acknowledged misleading Trump about troop levels in Syria. Swan and Basu observed: “It was a stunning admission. But it was one that reflected the mindset of some of the national security leaders and savvy bureaucrats who had repeatedly thwarted the commander in chief’s demands over four years.” What they all had in common was representing the blob rather than the American people. Jeffrey was rewarded for his disloyalty with a comfortable think tank sinecure.

The Trump experience offers a warning to any future president who challenges Washington’s permanent war culture and its enablers.

The president controls only one aspect of his presidency: his staff. He doesn’t choose legislators, journalists, bureaucrats, or lobbyists. Nor does he select foreign leaders and events. Unfortunately, Trump didn’t understand the importance of choosing his people carefully.

Swan and Basu noted that “Trump would grow more and more frustrated. He had become convinced that the Pentagon was working against him, boxing him into staying in countries that he broadly viewed as terrorist-filled gas stations in a desert.” And Trump was right. The Defense Department’s objective evidently was to never leave any spot on earth where U.S. military forces range. This official obstruction was especially effective because of his neglect, however. Swan and Basu explained, “He would rant about ‘deep state’ subversion, but those talking him out of his instincts were mostly people that he himself had appointed.” He gave away authority over his own presidency.

It is bad enough for a president to choose people who won’t actively implement his agenda. It is far worse to turn the administration over to those determined to obstruct his policies. Swan and Basu highlighted the problem: “Trump did not help his own agenda when he surrounded himself at the start with generals, many of whom had made their careers at U.S. Central Command. They fundamentally disagreed with the president’s worldview. They were personally invested in Afghanistan. And several would come to see it as their job to save America and the world from their commander in chief.” In truth, they were the primary architects of nearly two decades of dismal failure, yet Trump allowed them to determine policy for the future.

Trump’s experience shows the importance of a president choosing those committed to implementing his vision and doing so from the start. Although McEntee provided Trump with important allies, like MacGregor, by then it was too late. There was little time to make changes the president could have easily mandated earlier.

Swan and Basu related the comic opera routine that occurred when Macgregor requested the White House draft the formal order to pull out: “His own decision to seek a presidential order for an immediate Afghanistan withdrawal had set off a bizarre round of bureaucratic make-it-up-as-you-go. Late on Nov. 10, one of McEntee’s subordinates drafting the memo for the president called Macgregor to say they didn’t know how to do it: ‘We’re trying to put this together but we don’t have a model for this and we want to get the language straight’.”

The president also must recognize that the Pentagon, like any other agency, will stymie, lie, dissemble, sabotage, and stonewall. Swan and Basu quoted Trump’s early political advisor Steve Bannon on the generals: “They literally would not give you any information. And the information they gave you was bullshit. In every presentation, they say you’re 18 months away from turning the war around. Always. You’re always 18 months away.”

Of course, some military officers believe their own propaganda. They often labor assiduously to avoid confronting reality. They hate to admit defeat. They seek to push failure into the future, onto their successors. When I visited Afghanistan a decade ago, some officers were refreshingly candid, but only when we were talking informally, without their superiors present. For years American military personnel continued to die in Afghanistan for an optimistic future that never arrived.

Even now, the military brass peddles shopworn arguments when it has nothing better to offer. Wrote Swan and Basu: “The generals pushed aggressively for more troops, warning that pulling out could create a vacuum for terrorists to gain a stronghold like the Islamic State group, or ISIS, did when President Obama withdrew from Iraq in 2011.” In fact, Iraq’s problem was continued sectarian conflict and corrupt administration, not lack of a residual U.S. force presence, which would have been a target for the discontented on all sides. As for Afghanistan, the world is full of other ungoverned and ill-governed places, where terrorists already can and do locate.

Pentagon officials consistently played on Trump’s fears. As Swan and Basu described:

They painted a vivid picture of Kabul falling to the Taliban if U.S. forces withdrew precipitously in the final days of the Trump presidency. In previous conversations with Trump, they had raised the specter of Saigon in 1975, where images of American helicopters evacuating people from rooftops as the North Vietnamese took control of the capital city would become engraved in the historical record of the Vietnam War. The unsubtle warning: This would be Trump’s legacy if he rushed to the exit.

An ugly picture, to be sure, but those making these claims were the same people who had blocked troop withdrawals earlier in the Trump’s presidency. No one would have been talking about a hurried exit at the end of his term had the military not earlier resisted his clear wishes. By making a measured withdrawal impossible, and then using that failure to oppose any pull out, the hardline “remainers” sounded a bit like the defendant who murdered his parents and then asked the judge for mercy as an orphan.

Any peace-minded president also will inevitably face what amounts to the Senate’s warmonger caucus. It concocted the worst arguments on behalf of endless war. Alas, Trump’s own failings made him uniquely susceptible to such claims. Wrote Swan and Basu:

Hawks like [Sen. Lindsey] Graham cynically used this argument—”stay there to protect the oil”—to convince Trump to keep forces in Syria. They were playing to Trump’s long-held view that the U.S. should have taken the oil from Iraq after the 2003 invasion to subsidize the war effort. That would have breached international law. But they knew that transactional arguments were more likely to resonate with Trump than human rights arguments about the plight of the Kurds or the fate of Afghan women. So they talked about the oil.

This is a terrible reason to illegally occupy another country and insert U.S. military personnel into a war zone involving multiple hostile forces. But regarding North Korea, Graham had earlier dismissed the risk of nuclear war since any conflict would be “over there.” Preserving peace was never his concern.

Ultimately, the president is elected by the people to decide the toughest issues. That includes issues of war and peace. In failing to enforce his will he failed the American people. Wrote Swan and Basu: “As passionately as Trump apparently felt about pulling America out of the Middle East and Afghanistan, he avoided giving an order to force the military’s hand.” It his responsibility to do so, to force the Pentagon to act after he decided that U.S. troops should come home. In the end, he could blame no one but himself for not pulling American forces out of multiple conflicts abroad.

Afghanistan is a tragedy. But it no longer should be America’s tragedy. Now Biden must fulfill Trump’s promise to end the conflict.