Early in the new administration, the White House wanted a big win for President Trump on one of his top campaign promises — getting rid of poor performers at the Department of Veterans Affairs.

Scott Foster got the order from his boss, a senior political appointee: Draw up a list of underachievers and give “your best 10” so the president could announce their firing at a signing ceremony for a law allowing fast dismissals at VA.

Foster, a seasoned personnel official, balked. The employees still had the right to due process, he argued. Within weeks, his boss tried to sack him.

It was one of the first shots in what became an unwavering four-year war on the civil servants who have operated as the backbone of the federal government for more than a century. Career employees from diplomats to budget analysts have come under siege as they carry out the laws of Congress, attacked by a president with no government experience and portrayed as a “deep state” trying to undermine him.

Trump has targeted high-profile figures such as Anthony S. Fauci, a government scientist who has advised six presidents and whose dire warnings about the coronavirus pandemic angered him. He ridiculed Lt. Col. Alexander Vindman, the decorated Iraq War veteran and Ukraine expert on the National Security Council staff who testified in the inquiry that led to Trump’s impeachment — then he ordered him marched out of his office with his twin brother, another career military officer.

Vindman retired in July after what his attorney called a campaign of White House intimidation and retaliation.

Beyond these recognizable faces, employees across the government were banished to basement offices, denied promotions and excluded from decision-making. Government service has been undermined in the process, employees and observers say, endangering not just the government’s routine functions, such as ensuring clean water and fighting wildfires, but also its response to rare events like pandemics.

When they challenged the legality of politically motivated orders, promoted the conclusions of experts or questioned the direction of policy, career employees found themselves sidelined. Some wound up on the president’s Twitter feed. Loyalty was prized above all.

In the past four fiscal years, the Office of Special Counsel, an independent anti-corruption office, has received 20,505 complaints from federal employees alleging government wrongdoing, retaliation for whistleblowing or other improper treatment, a 36 percent jump from President Barack Obama’s first term, data shows.

Rather than coax the workforce into executing his agenda, Trump and his team wrestled the bureaucracy into submission and touted the effort as a major achievement. They bristled at rules that prevent them from simply firing employees they do not like, as Trump did on “The Apprentice.”

The president went even further last week, signing an executive order that removes job protections for an estimated tens of thousands of civil servants, allowing them to be dismissed with little cause or recourse. The sweeping effort to crack the foundation of government employment probably would be rescinded if Joe Biden is elected president. But it shows the mistrust at the core of Trump’s worldview.

“It’s not how the enormous enterprise we call the federal government works,” said Donald Kettl, a public-affairs professor at the University of Texas at Austin. “Bending the apparatus of the state to his own will — there’s an authoritarian tint to that that is impossible to escape.”

White House spokesman Judd Deere, in a statement, called government workers “the Swamp,” saying they have “fought so hard against this President every step of the way” as he “fought tirelessly in his effort to make Washington accountable to the American people.”

“Many of these entrenched liberal bureaucrats are only out for themselves and never understood the importance of the President’s agenda or why the American people elected him,” Deere said.

Barry Bennett, a longtime Republican strategist who served in the George W. Bush administration, said that Bush fought similar roadblocks but that Trump broke through them, even though he installed fewer senior political appointees: “What is new is that Trump was able to get more of what he wanted done.”

'We move them out of the way'

The attacks mobilize the president’s base, which tends to hold government in low esteem.

Secretary of State Mike Pompeo acknowledged as much in a Florida radio interview this month. When host Bud Hedinger raised the prospect of “anti-Trump or deep-staters buried in the State Department” pushing back against Trump’s foreign policy agenda, the secretary said,“When we identify them, we move them out of the way.”

“We get them to a different place,” Pompeo continued, “and we try to find people only who are committed to doing America’s mission, President Trump’s mission, on behalf of the United States.”

Veterans of the hollowed-out diplomatic corps worry that rebuilding will take a generation.

At crisis points in his presidency, Trump has moved to silence government offices when their work reflected poorly on his leadership. As the pandemic exploded, he shifted key responsibilities of the Centers for Disease Control and Prevention to more-compliant political appointees elsewhere in the government. And he transferred much of the response to his son-in-law and senior adviser, Jared Kushner, who assembled a shadow task force, largely consisting of private industry players, that further confused lines of command.

The career staff takes policy direction from every White House, following the lead of political appointees. The staff, in turn, shares its knowledge to help the administration run the $4.5 trillion government, whose day-to-day challenges tend to be less political than technical.

Trump ran against big government four years ago and promised he would “cut so much your head will spin.” He didn’t.

The workforce of 2.1 million has grown about 1 percent, data from the Office of Personnel Management shows, as Trump advanced priorities such as veterans care, border security and the military and squeezed smaller agencies focused on science, diplomacy, the environment and labor. Those agencies have felt the president’s wrath.

Nowhere has Trump’s campaign to undermine career public servants been more forceful than at the Justice Department, where politics flowed into a system long insulated from partisan pressure.

Half a dozen career prosecutors resigned from high-profile cases this year to protest their belief that the president and his attorney general, William P. Barr, had sought to influence cases involving the president’s allies, undermining the agency’s most enduring principle of equal justice under law.

Many civil servants quit Trump’s government in frustration. Others were forced out, if not by overt firings then by efforts to make their jobs untenable. A growing number have gone public with their concerns.

Still others kept quiet, choosing to ride out the storm.

Longtime public servants worry the purges already have cut into public trust in a government on the cusp of producing a coronavirus vaccine. Public service may have lost its luster just as it needs a new generation to backfill a workforce preparing to retire.

Foster, 54, stayed at VA, taking a cut in pay and rank for a lower-profile personnel role teaching senior leaders not to retaliate. His attempted removal by Peter O’Rourke, who went on to become acting VA secretary before his firing, was stopped by the Office of Special Counsel. O’Rourke, who the VA inspector general found had used his power as head of an accountability office to end investigations of allies, did not returns calls seeking comment.

“I loved working there,” Foster said of his job at VA headquarters. “This broke my heart.”

'Not loyal to the flag'

Like Pompeo, some of Trump’s lieutenants made no secret of their distrust of their staff.

“I got 30 percent of the crew that’s not loyal to the flag,” Ryan Zinke, Trump’s first interior secretary, proclaimed to an oil industry group in 2017, complaining that his employees were sabotaging his shift toward a more business-friendly regulatory culture.

Soon Zinke had ordered the involuntary reassignment of dozens of the public lands agency’s most senior civil servants. A top target was Dan Wenk, the veteran superintendent of Yellowstone, the crown jewel of the national park system.

Wenk had planned to retire last year after finishing several wilderness preservation and conservation projects. But he clashed with Zinke over the bison population in the park, a point of contention with private ranchers whose cattle compete with them for pastureland. At the time, Zinke, a former congressman from Montana, needed to woo powerful ranchers as he eyed a future in state politics.

Wenk, 68, resisted Zinke’s order to move many of the bison out, saying there was no basis for it. In the spring of 2018 he was informed by form letter of a reassignment to Washington. He chose to retire early.

Wenk said his ouster was designed to send a clear message: “‘If we can do this to Dan Wenk, we can do it to anybody.’ How else do you control an agency with as broad public support as the Park Service?’’

Russell Travers met a similar fate after reaching the pinnacle of his career as acting director of the National Counterterrorism Center, created after the 9/11 attacks to monitor threats to the country.

A highly regarded intelligence professional, Travers went through official channels to report his worry that the Trump administration was eroding the center’s mission with budget cuts and the winnowing of experts detailed from government agencies. He was losing senior analysts: By last year his staff had declined by 16 percent since its high point six years ago.

Travers, 64, was removed from his job in March by the acting director of national intelligence at the time, Richard Grenell, with no explanation, he said. A spokeswoman said at the time that he was offered another assignment. Travers retired.

He now spends much of his time mentoring college students considering national security careers: “They’re asking, ‘Do I really want to get into government in this climate?’ ”

Pressure on scientists

As Trump assumed control of the government, his antagonism toward the human role in climate change alarmed government scientists. Their dissent was immediate — and so were efforts to squelch it.

Scientists at the Park Service say political appointees have sought to censor their research if it clashes with the president’s ideology.

Patrick Gonzalez, the agency’s principal climate-change scientist, said that he has resisted pressure to cut references to human-induced warming in his academic writings and block him from speaking publicly about his work.

“In both cases the National Park Service attempted to violate scientific integrity, and in both cases I refused,” said Gonzalez, who also is an associate adjunct professor at the University of California at Berkeley and was not speaking in his official capacity. “I have continued my research and I’ve continued communicating, because communication is an important part of science.”

He continues to advise park officials at different sites, Gonzalez said, but when it comes to the agency’s senior leaders, “they don’t request my scientific advice.”

Asked whether Gonzalez was pressured, Interior Secretary David Bernhardt said in an interview, “I have never met with or talked to that person in my life.”

Bernhardt noted that he is married to a federal civil servant, was “the first secretary of either party to have a civil servant serving as my principal science adviser” and has regularly solicited guidance from career staffers through an ideas box.

Other scientists were less fortunate as they sought to promote their colleagues’ research.

The National Oceanic and Atmospheric Administration would not seem a typical target for political meddling. The agency regulates fisheries, maps U.S. coastal waters, predicts the weather and operates a multibillion-dollar satellite constellation.

It is also one of the world’s top climate research agencies. At first, NOAA’s civil servants, removed from the high-profile regulatory roles of the Environmental Protection Agency, did their jobs unimpeded.

Then in 2018 the agency released a congressionally mandated report warning that climate change is causing extensive harm to the country and will damage the U.S. economy if emissions are not sharply curtailed. The president said he did not believe its conclusions.

After a member of the communications team at the National Weather Service, which is part of NOAA, tweeted some of the climate-change findings, he got a formal reprimand and was told to stop tweeting on the agency’s accounts. About three months later, the official was transferred from the administrator’s suite to a low-profile office that helps local officials prepare for weather hazards. He asked not to be identified, for fear of retribution.

A NOAA spokesman said the official was moved to a different office as part of a change in priorities. The Weather Service’s media account has not tweeted about climate change since.

Bolton book

When the stakes for Trump were personal, the potential for collateral damage grew.

Ellen Knight had a top-level security clearance, 16 years of experience in government and a career filled with accolades when she was detailed to the White House in 2018 to lead pre-publication reviews at the National Security Council. National security adviser Robert C. O’Brien eventually put her in charge of a 14-member team of experts on classified information. A permanent management job at the NSC was assured.

The White House had assigned her a pre-publication review of an unflattering, tell-all book manuscript written by John Bolton, Trump’s former national security adviser.

Knight and her colleagues spent hundreds of hours with the manuscript, working with Bolton and his attorneys to remove classified information and damaging references.

But she refused to sign a declaration about the book prepared by administration lawyers that she believed to be incomplete and misleading, her attorney, Ken Wainstein, said in a letter filed in a federal court case about Bolton’s book.

After concluding her review, Knight was instructed by a White House lawyer to tell Bolton that the coronavirus pandemic had delayed final approval.

Only later did she learn that a White House lawyer with little or no experience with pre-publication reviews had taken the unprecedented step of starting a second review that contradicted Knight’s scrub of the document. Knight questioned the politicization of the process.

At one point, Wainstein said in the letter, Knight asked White House officials “how it could be appropriate that a designedly apolitical process had been commandeered by political appointees for a seemingly political purpose.”

In August, Knight was notified that she would immediately be reassigned to the National Archives, despite previous assurances that she would be permanently hired at the NSC. A spokesman for the NSC declined to comment.

John P. Fitzpatrick, the senior executive who recruited Knight to the White House in 2018 and retired last year, called her sidelining a painful symbol of the toll the agency has suffered during the Trump era, a time of record turnover.

“She is the type of person that anyone would want on their staff,” Fitzpatrick said.

Fitzpatrick said there were so many abrupt dismissals of well-regarded personnel in the Trump era that the NSC’s human resources staff had to develop a special protocol to deal with exiting personnel, their clearances and reclaiming classified material.

Diplomatic corps

The State Department became another powder keg, a revered agency turned on its end as two controversial leaders slashed its budget and brought on the smallest number of new Foreign Service officers in a generation.

An anxious mood pervaded the Harry Truman Building in Foggy Bottom soon after Trump took office and issued an executive order barring travelers from seven Muslim-majority countries. More than 1,000 U.S. diplomats criticized the policy in an official dissent cable, a previously acceptable outlet for disagreement that became the first of many loyalty tests.

Diplomats were sidelined and excluded from senior jobs in Washington. Returning ambassadors were reassigned to process public records requests. An exodus depleted the ranks of high-ranking Foreign Service officers and civil servants. For the first time in more than a century, all assistant-secretary slots are filled by acting heads or political appointees.

Overseas, Trump has stocked the ambassador corps with an irregular number of political appointees, hitting 57 percent last year, well above the 30 percent common in most administrations.

“The disillusionment is not going to just be fixed by Joe Biden if he wins,” said Eric Rubin, a former ambassador and president of the American Foreign Service Association, a union that represents Foreign Service officers.

The association has proposed that Foreign Service officers and civil servants who left be allowed to return at their former grade, “because we’re going to have such a challenge building back,” Rubin said.

For every public servant who left is someone who decided to stick it out, careful not to attract attention.

That is what happened at the Energy Department’s Office of Energy Efficiency and Renewable Energy, which was tasked by political appointees this year with carrying out a presidential whim as the election neared.

It was an appeal to suburban women. Trump issued a barrage of complaints at campaign rallies about the allegedly declining performance of dishwashers, shower heads, toilets and lightbulbs he said made him look orange. He blamed government efficiency standards.

The standards had been in place for years, and there was no groundswell of complaints from the industry. But the engineers and analysts put aside other priorities. The political appointees dictated that they approve a new class of dishwasher that cycles in less than an hour and change the existing shower-head rule to allow multiple nozzles at a time — and a bigger blast of water.

“We can resist for only so long,” said one official who was not authorized to speak publicly and commented on the condition of anonymity.

The White House fast-tracked the new regulations. They were far enough along that Trump would brag at a campaign rally in Nevada last week that his administration had made sure shower heads and dishwashers gave powerful blasts of water, regardless of the extra energy use. It would be like the old days.

The dishwasher rule was finalized last week. Environmental groups are gearing up for a lawsuit. The shower-head rule could still make it across the finish line — or be killed by a new administration in Washington.

Andrew Ba Tran and Alice Crites contributed to this report.

Correction: An earlier version of this report understated the increase in complaints to the Office of Special Counsel over the past four fiscal years. They are up 36 percent from Obama’s first term, not 26 percent.