When President Trump’s White House used its official Twitter account Tuesday to criticize Lt. Col. Alexander Vindman, a staffer on its own National Security Council testifying in the House impeachment inquiry, it seemed to some like a new low for Washington. But it was just another day for Trump’s NSC. The staff, which traditionally helps presidents manage the government and make foreign policy decisions, has instead become accustomed over the past three years to name-calling and accusations of disloyalty.

That’s because, more than any other place in government, Trump’s NSC has been home to a pitched and persistent battle between those dedicated to this irregular presidency and those who prefer the regular way Washington has made national security policy for decades. Trump is far from the first president to quarrel with the bureaucracy or those serving in it. But this fight has lasted longer and grown far more heated for two reasons: First, Trump brought incredibly unorthodox views to the West Wing. And second, the NSC’s power grew immensely during the post-9/11 wars, making it a force difficult to tame.

Nasty tweets are not the only consequence of the resulting breakdown. Trump’s misbegotten scheme to pressure Ukraine — in which he risked Ukrainian lives, America’s interests and his own presidency — was a byproduct of the running battle at the NSC. As the impeachment inquiry consumes Washington and crises break out around the world, the distrust at the heart of government will mean more trouble for the United States in the remainder of Trump’s presidency.

Trump inherited the most powerful NSC in history. Sept. 11, 2001, changed much about America’s relationship with the world, but it also reshaped Washington institutions. President George W. Bush and his allies in Congress took several institutional steps to ready the country for war against terrorism in Afghanistan, Iraq and elsewhere. This war footing required new security measures, new agencies and new processes in government.

A “wartime” NSC, as former national security adviser and secretary of state Condoleezza Rice called it in an interview for my book on the history of the staff, was required to manage it all. To support a commander in chief leading a global war on terrorism, the staff had to get bigger and more involved. The NSC doubled in size to 200 people, got access to advanced technology and became accustomed to reaching deep into the military’s chain of command to drive strategy, as when Bush staffers helped develop and advocate for what became known as the “surge,” which sent 30,000 additional troops to Iraq.

When President Barack Obama, who had questioned many of Bush’s wartime decisions, took office, the NSC did not revert to peacetime form. Instead, Obama chose to retain Bush’s so-called “war czar,” Lt. Gen. Douglas Lute, and made the NSC even larger, combining it with a homeland security staff Bush had created after the 9/11 attacks. The 44th president used the NSC’s more-than-400-member staff to reshape the wars, including with his own surge in Afghanistan, and the rest of U.S. foreign policy, to the point many in Washington complained about the council’s “micromanagement.”

Through it all, the stronger NSC, mostly made up of military officers, diplomats and spies loaned by agencies like the Pentagon, became the heart of national security policymaking. People competed aggressively to work there. Staffers’ calls, emails and video teleconferences were returned first and fastest. And their running system of meetings and memorandums, known to many in Washington as the “interagency,” was where the most important decisions were made.

When President-elect Trump first visited the Obama White House in November 2016, he was reportedly awed at what he would inherit. But the feeling was far from mutual. Staffers, whose one- and two-year assignments are designed to ensure continuity during administration turnovers, wept after the election and were anxious about their incoming boss. After all, Trump had little experience in national security and had questioned the very wars, alliances and international order to which many of them had dedicated their careers.

That early awkwardness quickly turned to antagonism. Like many in government, the NSC staffers had spent months preparing for the transition, writing more than 100 memorandums on policies and processes to hand off to their successors. But Trump’s team was not nearly as organized. Michael Flynn, a rambunctious retired Army lieutenant general whom Trump selected as national security adviser, appeared to many on the NSC to be impervious to its memos or machinery. Instead, he stuck close to Trump in New York and sought to hire several loyal lieutenants, who became known as “Flynnstones,” with similarly heterodox backgrounds and views.

The NSC staff fought to explain to the new team how the regular order worked. But they were often rebuffed: According to a Politico report, one Trump hire explained, “The president doesn’t care about the things you care about, and the sooner that you know about it, the better.” In those early days, nearly everyone in Washington heard about the friction at the NSC, especially after Flynn put controversial White House political adviser Steve Bannon on the council’s esteemed principals committee.

Trump’s decision to replace Flynn with Lt. Gen. H.R. McMaster, who had little experience in Washington but was respected by its national security community, might have cooled tensions. But the staff was already deeply divided between Flynnstones and those staffers who had arrived under Trump’s predecessor. Trump loyalists often accused the latter of being “Obama holdovers” or part of a “deep state” opposed to the new president.

Although McMaster did not use the labels himself, bringing peace to the NSC staff proved impossible. The fights over policy were pitched, the leaking prevalent, and the whispers about McMaster’s own standing with Trump persistent. At one point in 2017, a staffer circulated an extraordinary memo arguing that some in the government, including on the NSC itself, were bent on subverting Trump’s agenda. The aide was quickly fired, but the fact that the memo was written at all indicated that the battle at the NSC was far from over.

Soon enough, Trump replaced McMaster with lawyer and longtime Washington player John Bolton. Although made in the name of supporting the president, Bolton’s changes were also driven by his own views on how government should work. He took steps to make the interagency more “efficient,” limiting the number of meetings, their size and the list of people who dealt with Trump. But later, when Bolton fell out of Trump’s favor (over disagreements on Iran, North Korea and more), there were no longer the meetings or respected coordinators to force the warring parties to one table.

The U.S. relationship with Ukraine proves how chaotic the breakdown became. Trump and outside advisers like Rudy Giuliani — with the help of some around government and at the White House, reportedly including NSC staffer Kashyap Patel, a Republican foreign policy operative with little Ukraine experience — appear to have gone one way, pursuing what some have called an “irregular” scheme to pressure Ukraine to investigate a potential political opponent. Meanwhile, Vindman and others continued to follow what they believed was the official policy of supporting Ukraine against Russian aggression.

The result bordered on the tragicomic: Reports suggest that Trump did not know whether Patel or Vindman was the NSC’s point person on Ukraine, Bolton was in no position to correct him, and everyone from Kyiv to Washington was left trying to figure out what the real policy was and who was in charge. Although the potential illegality and impeachability of the Ukraine affair makes it unique, the misbegotten idea probably got off the ground only because of the NSC’s messy breakdown. The battle continues, too, as Vindman and other staffers appeared before Congress in defiance of the White House’s wishes.

Today, as the NSC’s dirty laundry is aired on Capitol Hill, Trump’s fourth national security adviser, Robert O’Brien, is trying to change how the council works. In an opinion piece a few weeks into the job, he wrote that the staff “should be streamlined” and its “historical mission” of coordination restored. By shrinking the staff and prioritizing regional over functional expertise, O’Brien appears finally to be taking the NSC off its wartime footing.

Yet even with the changes, the White House tweet about Vindman’s testimony is a reminder that there will be little peace at the NSC. At a time when the United States faces foreign policy challenges in every region and of nearly every type, the most important institution in the U.S. government is at war with itself. We will be fortunate if the fight at the NSC is the only war to worry about.

Twitter: @johngansjr