After a rare weekend session, the Senate passed a $1.1 trillion spending bill Saturday night that keeps most of the government funded through September.
It passed 56-40, with 18 Republicans and 21 Democrats voting against it.
The vote came after Democrats and Republicans negotiated back and forth throughout the day and night on how they would proceed.
Senate leadership was caught by surprise Friday night when Sen. Ted Cruz along with Sen. Mike Lee blocked a procedural vote to set up a final vote for the omnibus bill on Monday.
Senators who had already skipped town were forced to cancel their plans and turn around back to the Capitol. Republican Sen. Bob Corker, who next year will be the chairman of the Foreign Relations Committee, had to cancel a trip to Iraq and Turkey because of the move.
Democrats later huddled in Reid's office and talked over a Chinese food dinner about how to proceed. Ultimately a deal was reached sending the bill to Obama's desk Saturday night, instead of having a procedural vote at 1 a.m. on Sunday and a final vote early Monday.
Republicans ate Chick-fil-A for lunch while procedural votes took place.
The deal allowed Democrats to file cloture on the less controversial presidential nominees, saving hours of legislative slog. Democrats were ultimately able to set up votes on all 24 nominees they wanted to confirm, according to a Democratic leadership aide.
Among the more controversial nominees that made it onto the docket was Vivek Murthy, Obama's pick for Surgeon General. Murthy's nomination has been held up for months because of strong opposition from the National Rifle Association over his position on gun control.
Republican Sen. Lindsey Graham directly blamed Cruz for helping Reid advance so many nominees, saying his tactics were misguided.
"I haven't seen Harry smile this much in a long time," Sen. Lindsey Graham said. "Don't like it."
Cruz was still able to force an up or down vote on Obama's immigration executive action by using a procedural tactic before the bill was ultimately passed. The "point of order" vote failed 22-74. Several GOP senators who have said they are against Obama's executive order voted "no" anyway, including Sens. John McCain and Ron Johnson, in a protest against Cruz's delay tactics.
Sen. Bob Menendez, a Democrat, screamed "absolutely no!" when voting against the Cruz point of order.
Speaking with reporters after the final vote, Cruz conceded that had a vote against Obama's immigration executive order taken place earlier in the week, it would have had more support.
"The division among Republicans is, I think at this point, a procedural division," Cruz said.
Jacob Fischler is a political reporter for BuzzFeed News and is based in Washington, D.C.
Contact Jacob Fischler at email@example.com.
Got a confidential tip? Submit it here.