President Trump has abandoned his administration’s faltering effort to dissolve a key federal agency, a major setback in his three-year battle to keep his campaign promise to make government leaner and more efficient.

The Office of Personnel Management will remain the human resources manager of the civilian workforce of 2.1 million employees, and its functions will not — for the foreseeable future at least — be parceled out to the White House and the General Services Administration.

The White House hoped that shuttering the agency of 5,500 employees could serve as a blueprint for eliminating other federal offices as Trump tries to contain the size and scope of a bureaucracy he targeted as duplicative and inefficient — and rein in a workforce he views with skepticism.

But an 18-month effort by a top Office of Management and Budget official to eliminate the government personnel office left the plan on life support, despite a bipartisan consensus that the operation is deeply troubled.

Congressional Democrats and Republicans whose support was essential to disbanding the agency dismissed the plan as ill-conceived and unlikely to save money or shrink the federal workforce. A sweeping defense authorization bill that appeared to be headed for approval on Capitol Hill on Wednesday relegates the breakup to an independent study committee, a common face-saving solution for ideas that tend to be going nowhere.

The agency would have been the first stand-alone federal department of its size to be eliminated in decades.

In recent weeks, Trump soured on continuing the fight after seeing an obscure Washington-area television program about government, according to White House officials, who spoke on the condition of anonymity because they were not authorized to speak publicly. WJLA’s “Government Matters” has aired several segments about the OPM proposal. Top budget office and other White House officials were rushed to meet with Trump the following day.

The president told his top advisers that with a win unlikely, the already unpopular plan would bring him poor reviews. Acting chief of staff Mick Mulvaney and acting budget director Russell Vought, along with Margaret Weichert, the White House official leading the effort, tried to persuade Trump to keep going in line with conservative principles of shrinking government, the officials said.

But the president stood firm. He has soured on other plans that his aides said he once embraced, including a public-private push for infrastructure, and has sometimes been skeptical of budget-cutting ideas from Mulvaney and his allies in the budget office.

“The president has been very clear that the reforms to make government more efficient shouldn’t have a negative implication for federal workers in that agency,” Rep. Mark Meadows, (R-N.C.), a founder of the conservative House Freedom Caucus and a Trump ally, said of the proposal.

Meadows acknowledged that “there’s a lot of distrust related to any effort to rearrange, reform and redirect a federal asset.”

Rep. Gerald E. Connolly (D-Va.), chairman of the House Oversight and Reform Committee’s subcommittee on government operations, which blocked the plan, said the Trump administration never provided a good rationale for it.

“The goal of shrinking government is neither good nor bad, but it has to be tied to something,” he said. “If the goal is to make government more efficient, they didn’t make a pretense at a rationale.”

Mulvaney, Connolly said, “saw this as a point on the scoreboard to say, ‘I abolished a federal agency and the consequences be damned.’ For once, Trump’s political instincts are better than Mulvaney’s.”

Rachel Semmel, a spokeswoman for the OMB, said it welcomed the study. “This Administration remains committed to reforms — including organizational improvements — that will increase the service and stewardship of the Government for the American people,” she said in an emailed statement.

The administration had argued that the OPM, created in 1978 to oversee the civil service and coordinate hiring policy, retirement benefits, health insurance and other policies for the federal workforce, was failing at its mission.

It is widely viewed as slow and ineffective, with antiquated technology systems that make personnel data vulnerable to cyberattacks and risk-averse leadership that hasn’t responded to calls for faster hiring and recruiting.

Even as the plan is shelved, Weichert, deputy director for management at the budget office, has continued to make the administration’s case. On Wednesday, she hosted a White House summit with state government leaders from across the country to discuss best practices for consolidating government offices.

The backtrack underscores the challenge for any president calling for smaller government, but particularly for Trump, who campaigned on a promise to “cut so much your head will spin.”

His budgets to Congress have proposed major spending cuts at such agencies as the State Department and the Environmental Protection Agency, eliminated thousands of line-item programs and purging dozens of small agencies.

But the plans have largely been dead on arrival as Congress rejected the proposed cuts, even when Republicans controlled the House. Earlier this year, the president himself reversed his administration’s plan to wipe out almost $18 million in funding for the Special Olympics after his education secretary, Betsy DeVos, defended the unpopular proposal to lawmakers on Capitol Hill.

An ambitious government reorganization plan Mulvaney released last year when he was budget office director has languished without buy-in from Congress.

However, the administration has moved forward with three relocations, moving two economic research agencies at the Agriculture Department out of Washington to Kansas City and the Bureau of Land Management to Grand Junction, Colo. Both moves will reduce real estate costs and shrink the offices, because a fraction of their employees are moving.

The administration was forced in June to backtrack on killing a U.S. Forest Service program that trains disadvantaged young people for rural jobs after bipartisan outcry from Congress. The Forest Service had planned to begin layoffs of 1,110 employees by September, believed to be the largest number of cuts to the federal workforce in a decade.

“I don’t think I can say with confidence that I can point to a major restructuring of government the administration wanted to achieve at the outset,” said G. William Hoagland, a senior vice president at the Bipartisan Policy Center and former Republican staff director for the Senate Budget Committee.

He described the agencies moving out of Washington as “an asterisk in terms of the overall federal government.” He blamed spending disputes between the White House and Congress that have left agencies operating under temporary budgets that maintain spending at current levels rather than allowing cuts.

The OPM was an inviting target for the White House. Its massive background investigation operation was in the process of migrating to the Defense Department under an Obama-era initiative.

The proposed breakup would have divided OPM among three departments. The White House budget office would have taken over high-level policies governing federal employees. That plan was decried by federal employee unions as a backdoor ploy to politicize the civil service by installing political appointees close to the White House.

Weichert asked Congress for $50 million this fiscal year to carry out the reshuffling. She said the workforce would shrink through retirements and unfilled vacancies. although one plan, quickly shot down on Capitol Hill, included layoffs.

But critics panned the plan’s basic premise and execution. The administration did not conduct a cost-benefit analysis. Officials could not estimate the short- or long-term savings of the closure.

It was unclear whether GSA, the government’s real estate agency, was equipped to handle personnel policy. Morale at OPM plummeted.

The OPM’s inspector general weighed in against the idea multiple times, just weeks ago telling Congress that the White House had no documented plan or identified legal authority to move forward.

Besides countless hours of staff time, there were other casualties: Trump’s first personnel director, Jeff Pon, was abruptly shown the door last year because he openly opposed the breakup and asked the Justice Department how it could be legally carried out.

“You can’t look at it and say, here are the 20 great reasons to do it and the 20 bad reasons,” said Jeffrey Neal, former personnel chief at the Department of Homeland Security and now a senior vice president at ICF, a global consulting company. “It was more like, there were 20 bad reasons and one good reason.

“This wasn’t going to shrink government,” Neal said. “If you spend time tilting at windmills rather than carrying out your mission, you could argue the time has been wasted.”