WASHINGTON (AP) -- The U.S. government stumbled into a shutdown at midnight as a rogue Senate Republican blocked a speedy vote on a massive, bipartisan, budget-busting spending deal, protesting the return of trillion-dollar deficits on the watch of Republicans controlling Washington.

The shutdown — technically a lapse in agency appropriations — was the second government closure in less than a month, another product of election-year partisan disputes and persistent internal divisions in both parties.

It crept up slowly Thursday night after GOP Sen. Rand Paul repeatedly held up votes on the budget plan, futilely seeking a vote on reversing spending increases.

"I ran for office because I was very critical of President Obama's trillion-dollar deficits," the Kentucky senator said. "Now we have Republicans hand in hand with Democrats offering us trillion-dollar deficits. I can't in all honesty look the other way."

As the clock hit midnight, Office of Management and Budget Director Mick Mulvaney immediately implemented plans to close non-essential government operations, said spokesman John Czwartacki.

The move essentially started a race to the next deadline — the scramble to reopen the government before federal employees were due to report for work. The Senate planned to hold votes in the middle of the night and send the budget deal and temporary spending measure over the House by dawn.

If the measure passes in the wee hours of the morning, the government would open in the morning on schedule.

If not, a partial shutdown would essentially force half the federal workforce to stay home, freeze some operations and close some parks and outposts. Services deemed essential would continue, including Social Security payments, the air traffic control system and law enforcement.

At the White House, there appeared to be little sense of concern. Aides closed shop early in the 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.

Story continues

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. This time it was a Republican's turn to throw a wrench in the works.

Paul brushed off pleas from his fellow Republicans, who billed the budget plan as an "emergency" measure needed for a depleted military.

"We will effectively shut down the federal government for no good reason," said Sen. John Cornyn, as his requests to move to a vote were repeatedly rejected by Paul.

Paul was unfazed.

"I didn't come up here to be part of somebody's club. I didn't come up here to be liked," he said.

Approval of the measure in the Senate seemed assured — eventually — but the situation in the House remained dicey. In that chamber, progressive Democrats and tea party Republicans opposed the measure, which contains roughly $400 billion in new spending for the Pentagon, domestic agencies, disaster relief and extending a host of health care provisions.

However, 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.

The legislation doesn't address immigration, though Republican Speaker Paul Ryan 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, House Democratic Leader Nancy Pelosi of California made it plain she wasn't pressuring fellow Democrats 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 three-day government 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 record 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."

Combined with the Republicans' December tax cut bill, the burst in spending would put the GOP-controlled government on track for the first $1 trillion-plus deficits since Obama's first term and the aftermath of the most recent recession nine years ago.

"This budget deal shows just how broken the budget process is, that Congress thinks the only way to agree to a budget is to put hundreds of billions of dollars on the nation's credit card," said Maya MacGuineas, president of the Center for a Responsible Federal Budget, a Washington-based group.

The agreement would increase the government's borrowing limit to prevent a first-ever default on U.S. obligations that looms in just a few weeks. The debt limit would be suspended through March 2019, putting the next vote on it safely past this year's midterm elections.

___

Associated Press writers Matthew Daly, Alan Fram, Jill Colvin and Richard Lardner contributed to this report.