The House of Representatives voted 240-186. The GOP-controlled chamber needed help from House Democrats to clear the bill, and 73 Democratic members gave it. Sixty-seven House Republicans voted against the plan.

The colossal bill, which lawmakers have been negotiating for months, is a game-changing piece of legislation, clearing the decks for Congress in dealing with major spending issues as well as doling out disaster relief money and hiking the debt ceiling which was set to be reached next month.

The Senate approved the measure earlier on Friday morning. The federal government briefly shuttered for the second time in less than a month overnight, after Kentucky Republican Sen. Rand Paul prevented the deal from passing Thursday.

The shutdown came just weeks after Democrats and a handful of Republicans, including Paul, refused to support the last continuing resolution, causing a shutdown that lasted a weekend. The effects from the overnight shutdown were expected to be minimal.

Trump tweeted that the bill, which gives the Pentagon an additional $165 billion, was a "big victory" for the US military. But he said Hill Republicans were "forced to increase spending" in order to attract Democratic votes.

There was uncertainty about the timing of Trump's signing, and the Office of Personnel Management, which manages the federal workforce, still had an alert on its website early Friday morning that stated that due to a "lapse in appropriations, federal government operations vary by agency."

Just how many Democrats would come on board was a key question up until the final moments, as liberals were unhappy about the bill not addressing immigration and conservatives oppose the increased spending.

After the vote succeeded in the Senate, Senate Majority Leader Mitch McConnell kept his word to move to open an immigration debate next week . The majority leader moved to call a vote Monday to proceed to an unrelated House bill that will serve as a vehicle for a process unlike the Senate has seen in recent memory, where senators will be able to offer a number of amendments on competing immigration proposals to see which ones will secure the 60 votes needed to advance. But that will only happen if the House passes the continuing resolution later Friday morning.

JUST WATCHED Sen. Paul warns 'day of reckoning' is coming Replay More Videos ... MUST WATCH Sen. Paul warns 'day of reckoning' is coming 01:01

Drama but success

In the end, the votes were there -- but that didn't prevent heightened drama leading up to the vote. Democrats intensified their efforts to communicate they would hold firm in an effort to pressure Republicans to offer a commitment for a floor vote on immigration.

The overall deal also does not address immigration, a key sticking point for many Democrats, but it does increase spending caps by $300 billion for the Pentagon and domestic priorities, a crucial incentive for getting enough votes from both parties.

Leading up to the vote, House Minority Leader Nancy Pelosi urged her members to vote against the bill but also urged them to hold their votes back, forcing Republicans to show their strength.

That strategy provided several minutes of heightened drama on the House floor, as Republicans looked nervously up at a board that displays votes by member's name and the yes votes hung around 150.

But then a few Democrats began to signal their caucus to put their votes in with time ticking down, and the chamber grew quiet as the no votes and yes votes began pouring in.

It remained unclear Friday morning whether that effort would be enough, however, to placate an angry base about the Deferred Action for Childhood Arrivals policy being left out of the deal after months of pressing to have it included.

Illinois Rep. Luis Gutierrez, a key Democratic voice for immigrants and immigration reform, acknowledged to reporters shortly before the vote that there remained little to no venues for Democrats to use their leverage on DACA after this deal, though members would not give up.

After the vote, Pelosi vowed that the fight to protect undocumented immigrants brought to the United States as children from deportation was not over.

"I'm greatly disappointed that the Speaker does not have the courage to lift the shadow of fear from the lives of these inspiring young people," Pelosi said in a statement, referring to House Speaker Paul Ryan. "When we protect the Dreamers, we honor the highest ideals of America. Their patriotism, their perseverance, their optimism are an inspiration that stirs the conscience of our entire nation."

What's in the bill?

The massive two-year budget deal proposed by Senate leaders Wednesday raises budget caps by $300 billion in the next two years, increases the debt ceiling and offer up nearly $90 billion in disaster relief for hurricane-ravaged Texas, Florida and Puerto Rico.

About $165 billion would go to the Pentagon and $131 billion to non-defense programs.

"Our members who are focused on the military are very happy where we landed with that," Ryan told Hewitt on his radio show in reference to the defense spending caps.

The debt ceiling will be raised by the appropriate amount until March 2019.

Exact spending would be left to the appropriations committees, but included in the funding is $10 billion to invest in infrastructure, $2.9 billion for child care and $3 billion to combat opioid and substance abuse.

The bill also keeps the government running until late March.

Paul amendment holds up Senate vote

Paul took to the Senate floor many times Thursday refusing to agree to move up the time for a vote in the chamber on the bill, which requires unanimous consent from all 100 senators. In doing so, Paul forced the vote procedurally to occur after 1 a.m. ET on Friday, after government funding expired.

Paul slammed his colleagues for "hypocrisy" and lack of fiscal restraint, as well as a lack of a fair and open process.

"There is probably a lot of blame to go around for the Republicans who are advocating for this debt," Paul said to CNN's Erin Burnett OutFront. "But I would say, really, primarily, this is coming from Congress. Leadership in Congress in both the House and Senate has decided to move forward. But the funny thing is you know so often in the media we hear 'we want you to work together.' They are are working together but working together to spend a ton of money."

Republican leaders say Paul wanted a vote on an amendment that is critical of the overall agreement but leaders couldn't give him that vote even if they wanted to, because it requires consent from all senators.

The Senate's Majority whip sounded a bit frustrated by the holdup. Sen. John Cornyn, a Texas Republican, said he didn't know how long it would take to resolve the issue and said there are other procedural steps Paul could take to get a vote that leaders were talking to him about.

"Sen. Paul has some concerns he wants to be able to voice," Cornyn told reporters. "We're trying to work with him to help get that done."

Cornyn pointed out, "It takes unanimous consent to get an amendment."

"If we get one amendment up, you can imagine other people are going to have amendments," he said. "You can essentially accomplish the same thing by a point-of-order and get a vote. He doesn't need consent to do that. So that's an alternative we're going to suggest to him and work with him on."

Sen. Lindsey Graham, a South Carolina Republican, criticized Paul on Twitter.

"It appears 'General' @RandPaul is at it again. He just called for the immediate withdrawal of all forces from Afghanistan as a way to give the US military a pay raise," Graham tweeted . "Fortunately, only 'General' Paul -- and the Taliban - think that's a good idea."

This story has been updated and will continue to be updated with additional developments.