The underlying bill includes huge spending increases sought by Republicans for the Pentagon along with a big boost demanded by Democrats for domestic agencies. Both sides pressed for $89 billion for disaster relief, extending a host of health care provisions, and extending a slew of smaller tax breaks.

It also would increase the government's debt cap, preventing a first-ever default on U.S. obligations that looms in just a few weeks. Such debt limit votes are usually enormous headaches for GOP leaders, but the increase means another vote won't occur before March 2019.

House leaders hustled to move before federal employees were due back at work, hoping to minimize the disruption. A shutdown essentially cuts the federal workforce in half, with those dubbed non-essential not allowed to work. Military and essential workers would remain on the job regardless.

The Trump administration signaled it expected the shutdown to be short, calling it a "lapse."

As the clock hit midnight, Office of Management and Budget Director Mick Mulvaney immediately issued an order to close non-essential government operations.

Mulvaney told federal agencies they should execute their contingency plans and instructed federal employees to report to work Friday to "undertake orderly shutdown activities."

At the White House, there appeared to be little sense of concern. Aides closed shop early Thursday night, with no comment on the display on the Hill. The president did not tweet. Vice President Mike Pence, in South Korea for the Winter Olympics, said the administration was "hopeful" the shutdown would not last long.

But frustrations were clear in both sides of the Capitol, where just hours earlier leaders had been optimistic that the budget deal was a sign they had left behind some of their chronic dysfunction. Senate Democrats sparked a three-day partial government shutdown last month by filibustering a spending bill, seeking relief for "Dreamer" immigrants who've lived in the country illegally since they were children.

House GOP leaders said they were confident they had shored up support among conservatives for the measure, which would shower the Pentagon with money but add hundreds of billions of dollars to the nation's $20 trillion-plus debt.

House Democratic leaders opposed the measure — arguing it should resolve the plight of Dreamers — but not with all their might. House Speaker Nancy Pelosi, D-Calif., asked Speaker Paul Ryan in a Thursday night letter to promise he would bring an immigration measure sponsored by Reps. Will Hurd, R-Texas, and Pete Aguilar, D-Texas, up for a vote.

Ryan didn't immediately respond. He said again Thursday he was determined to bring an immigration bill to the floor this year — albeit only one that has President Donald Trump's blessing.

At a late afternoon meeting of House Democrats, Pelosi made it plain she wasn't pressuring her colleagues to kill the bill, which is packed with money for party priorities like infrastructure, combating opioid abuse and helping college students.

Still, it represented a bitter defeat for Democrats who followed a risky strategy to use the party's leverage on the budget to address immigration and ended up scalded by last month's shutdown. Protection for the Dreamers under former President Barack Obama's Deferred Action for Childhood Arrivals program, or DACA, expires next month.

Republicans were sheepish about the bushels of dollars for Democratic priorities and the return next year of $1 trillion-plus deficits. But they pointed to money they have long sought for the Pentagon, which they say needs huge sums for readiness, training and weapons modernization.

"It provides what the Pentagon needs to restore our military's edge for years to come," said Ryan.

Beyond $300 billion worth of increases for the military and domestic programs, the agreement adds $89 billion in overdue disaster aid for hurricane-slammed Texas, Florida and Puerto Rico, a politically charged increase in the government's borrowing cap and a grab bag of health and tax provisions. There's also $16 billion to renew a slew of expired tax breaks that Congress seems unable to kill.

"I love bipartisanship, as you know," said Sen. Jeff Flake, R-Ariz. "But the problem is the only time we discover bipartisanship is when we spend more money."

The deal contains far more money demanded by Democrats than had seemed possible only weeks ago.

"We're not going to get DACA as part of this," said Rep. John Yarmuth of Kentucky, the top Democrat on the Budget Committee. "So if we can negotiate a deal like I think we've gotten that essentially meets every other one of our priorities then I think that's where a lot of the Democrats are."