With less than three hours before a government shutdown, the House narrowly passed a massive spending bill late Thursday after a drama-filled day of vote counting and lobbying from the White House and Congressional leaders.
The measure passed by a 219-206 vote, with support from 57 Democrats.
The House also passed a measure that will fund the government for two additional days in order to give the Senate time to approve the legislation before the government runs out of funding. The Senate will approve the continuing resolution overnight and could vote on the $1.1 trillion spending bill as early as Friday.
House Democrats huddled Thursday night to discuss a way forward after the spending measure had prompted a public rift between the White House and progressive Democrats, who primarily objected to the bill's inclusion of a rollback of financial reforms. Sen. Elizabeth Warren of Massachusetts, famed as a thorn in Wall Street's side, branded those changes a "bailout" for big banks at taxpayers' expense.
But some key Democrats emerged from the meeting acknowledging it was better to pass the bill then risk another shutdown. Minority Whip Steny Hoyer, D-Md., said on the House floor it was "better to pass it than to defeat it."
The White House said Thursday that, while the administration "objects to the inclusion of ideological and special interest riders" in the bill, the president supports the overall legislation and will not veto it.
But House Minority Leader Nancy Pelosi - who also opposed the inclusion of the banking changes - publicly slammed the bill, calling its loosening of financial regulations "a ransom and a blackmail" and saying that she's "enormously disappointed" that the White House is accepting its inclusion in the spending measure.
After GOP leaders postponed a scheduled 2pm ET vote, Pelosi told fellow Democrats they had increased their "leverage" to amend the legislation and strip out portions they dislike, including an addition that raises donation limits to party committees.
"Well, here we are standing up to the White House and Harry Reid," Democrat Louise Slaughter told NBC News. "Good for us. They're wrong."
While officials insisted that they were not expecting a government shutdown despite the delay, the administration said that, "out of an abundance of caution," it is working with federal agencies to prepare for a lapse in funding.
Meanwhile, White House officials - including Vice President Joe Biden and President Barack Obama - worked the phones to push passage of the bill. And White House chief of staff Denis McDonough went to Capitol Hill late Thursday to personally lobby Democrats to support the measure in a closed-door meeting.
The Democratic split proved key, because Republicans needed a boost of Democratic support to get the bill over the finish line.
Democratic votes were needed to offset defections on the Republican side -- from conservatives who object to the bill because they said it doesn't do enough to curb the president's executive action on immigration.
The bill must still be passed by the Senate in the coming daysto avert a shutdown. That could be procedurally easy - but only if no member objects to its passage.
If even a single senator holds up the process, it could drag on for several days.But it is ultimately expected to pass.
Here's a brief summary of what's in the massive spending bill.
- Funding until September 2015 for 11 of 12 federal agencies. The Department of Homeland Security is only funded until early next year, setting up another spending fight over immigration in just a few weeks
- No new funding for the Affordable Care Act, but funding for the health care law is also not cut
- $5.4 million to fight Ebola abroad and prepare for potential outbreaks at home
- Changes to the 2010 Dodd-Frank banking reform bill concerning derivatives trading - lobbied for heavily by the banking industry
- Language prohibiting the District of Columbia from legalizing marijuana, which city residents greenlighted in a November ballot initiative by a wide margin
- Language raising donation limits to the Democratic National Committee or the Republican National Committee from $32,400 per donor to $324,000
- About $8 billion in funding for the Environmental Protection Agency, a substantial cut from last year's funding that will likely force a hefty reduction in staffing
- $5 billion to fight the Islamic militant group known as ISIS
- A ban on the transfer of Guantanamo Bay prisoners to the United States
- Funding to aid the State Department, the Department of Health and Human Service and local school districts in immigration-related programs
- A cut of almost $350 million to the budget of the IRS
- Cuts to multi-employer pension plans
- Language allowing school districts more flexibility in instituting the nutrition standards championed by Michelle Obama
NBC's Andrew Rafferty and Kristen Welker contributed to this report.