Just hours before a midnight deadline approached, the House of Representatives voted to approve a $1.1 trillion spending package to keep the federal government open -- sending the measure over to the Senate for final passage.
The House voted 219-206 to approve the measure with 57 Democrats joining 162 Republicans to pass the package.
At the conclusion of the House vote, House Speaker John Boehner, said "My job tonight is to say thank you and Merry Christmas."
The House and Senate approved a 48-hour continuing resolution to keep the government open so the Senate has time to pass the measure without shutting down the government. If a time agreement is reached, the Senate could vote on the funding measure as soon as Friday evening. If not, a Senate vote could be pushed into Monday.
If approved by the Senate, the spending measure would fund most of the federal government, except for the Department of Homeland Security, through September of next year. The Department of Homeland Security would only be funded through February 27, a move that allows lawmakers to revisit ways to counter President Obama's executive action on immigration.
The vote capped off a day of high-stakes drama as House lawmakers scrambled to gather enough votes after the deal was in jeopardy due to Democratic unease with last minute provisions added to the bill.
Democratic lawmakers, led by House Minority Leader Nancy Pelosi, were angry about measures that weakened campaign finance rules and rolled back limits on Wall Street banks. White House Chief of Staff Denis McDonough was dispatched to meet with House Democrats late Thursday, urging them to vote in favor of the so-called "cromnibus" package.
At the end of an hours long meeting with her Democratic colleagues, Pelosi urged her colleagues to stand their ground.
"I'm giving you the leverage to do whatever you have to do. We have enough votes to show them never to do this again," Pelosi said.
President Obama, Vice President Joe Biden, Cabinet members and other senior administration officials lit up the phones across Capitol Hill Thursday -- urging Democrats to pass a spending bill and avert a government shutdown.
It was a moment of unusual drama.
The initial vote on the spending measure was scheduled for 2:30 p.m., but the House remained in a holding pattern through the early evening with Democrats twisting arms and persuading lawmakers to support the plan that would keep the government running and avoid a shutdown before a midnight deadline. It was a bipartisan problem: Conservatives are opposing the measure because it doesn't do enough to stop President Obama's immigration order. Liberals are opposed, too.
"If we don't get finished today, we're going to be here until Christmas," Boehner told ABC News at a news conference. "You all know how this process works."
On the floor of the U.S. Senate today, Sen. Elizabeth Warren, D-Mass., criticized provisions of the spending bill that she says favor Wall Street interests.
"A vote for this bill is a vote for future taxpayer bailouts of Wall Street," Warren said in a feisty speech. "Why in the last minute as you head out the door and a spending bill must be passed are you making it a priority to do Wall Street's bidding? Who do you work for: Wall Street or the American people?"
Warren, who is often mentioned as a potential 2016 Democratic presidential contender, added, "It is time for all of us to stand up and fight."
Earlier today, the House voted 214-212 to pass a procedural vote to advance to debate on the bill, popularly known as the Cromnibus.
Michigan GOP Rep. Kerry Bentivolio, a former Santa impersonator and reindeer farmer, cast the deciding ballot after flipping his vote to push Republicans over the top.
Meanwhile, the Obama administration has alerted all federal agencies to dust off their contingency plans for a government shutdown "out of an abundance of caution," an OMB official told ABC News.
On a conference call this afternoon, the Office of Management and Budget asked agencies to "take steps to prepare for all contingencies, including a potential lapse in funding."
But the official suggested that the administration still sees that scenario as unlikely, noting both the omnibus legislation before Congress and various shorter-term back-up plans.
ABC's John Parkinson and Devin Dwyer contributed reporting.