U.S. Sen. Ted Cruz (R-Tex.) speaks with reporters after the U.S. Senate voted to approve the spending bill. Cruz had sought to slow debate on the bill by raising concerns with Obama’s immigration policy. (Win Mcnamee/Getty Images)

The Senate approved a sweeping $1.1 trillion spending bill Saturday night to fund most of the federal government through the next fiscal year.

A small group of conservatives, led by Sen. Ted Cruz (R-Tex.), had tried to block debate on the bill by raising concerns with Obama’s immigration policy, forcing a marathon weekend session. The move infuriated their colleagues, particularly Republicans who complained that forcing senators to stay in session produced nothing positive for the GOP and only helped Democrats in their bid to approve a final batch of Obama’s nominees for government posts.

For several hours Saturday, senators held procedural votes to begin the process of confirming dozens of Obama’s nominees for federal judgeships and top positions at the State Department and other agencies.

The move forced members of both parties to abruptly cancel holiday and retirement festivities back home. Some senators slogged through the Capitol hallways with their young children in tow. Several skipped the Army-Navy football game in Baltimore. Staffers forced to work entertained out-of-town guests by giving them rare weekend access to the Capitol.

Prolonged debate on the spending bill, which passed on a 56-to-40 bipartisan vote, came after Cruz and Sen. Mike Lee (R-Utah) late Friday night derailed a carefully crafted plan between party leaders to allow senators to go home for the weekend and return Monday to approve the spending agreement. The pair had sought to force a vote that essentially would block federal agencies from implementing the immigration policy changes ordered by Obama last month.

The U.S. Senate passed an extension of federal spending authority through midnight Wednesday, staving off the threat of a government shutdown. (Reuters)

But Senate Majority Leader Harry M. Reid (D-Nev.) blocked their request and angrily clashed with them on the Senate floor, ensuring that debate on the spending bill would spill into Saturday.

Democrats said the setback was an especially embarrassing blow to Senate Minority Leader Mitch McConnell (R-Ky.), who is slated to lead the chamber next year and has sought to complete unfinished business before GOP control begins. Confident that he had a deal with Reid, McConnell left the Capitol before 9:30 p.m. Friday, telling reporters as he stepped into an elevator: “See you Monday.”

The deal to allow senators a weekend reprieve blew up amid Cruz and Lee’s objections, and in so doing it compelled the Senate to be in session Saturday. Rather than passing the day by opening the floor to speeches, Reid decided to use the time to begin consideration of up to 20 of Obama’s nominees, almost half of whom Republicans had been blocking.

“We shouldn’t waste time,” he said.

Republicans agreed later to shut off the marathon votes and allow Reid to begin processing 24 nominees, including Antony Blinken to serve as a deputy secretary of state and Vivek Murthy to serve as surgeon general. The votes are scheduled to begin Monday morning.

If the Senate had voted Monday on the spending bill under the original agreement, Reid would have had to wait until Monday evening to start processing nominees, and Democrats feared that as the holidays drew closer, more of their ranks would have left town before confirming all the nominees. But with Cruz and Lee’s actions, Democrats were able to accelerate the confirmation process and made it far more likely they could approve every contentious nominee that GOP senators had been blocking.

“What Cruz did aided and abetted us getting nominations,” Sen. Charles E. Schumer (D-N.Y.) said.

When proceedings resumed Saturday, Cruz and Lee tried again to secure time to hold a vote on their amendment. But once again, Reid and the Democrats said no.

“We are stuck in Washington as long as Harry Reid insists that the Senate stay here,” Cruz angrily told reporters after he was rebuffed. He called the Senate leader’s decision “unfortunate” and “obstructionist.”

But several Republicans disagreed and nearly three quarters of senators later rejected a point of order by Cruz, a sharp repudiation of his tactics.

Sen. Susan Collins (R-Maine) called her colleagues’ tactics “unfortunate” and “counterproductive.”

“This reminds me very much of the shutdown last year, where the strategy made absolutely no sense,” she said, adding that until Saturday, liberals were being faulted for holding up the spending bill. “Now, I guess the blame will be shared,” she said.

Sen. Bob Corker (R-Tenn.) said Democrats whom he spoke with on the Senate floor were pleased with the ultimate outcome, despite the weekend session. “The White House is going to end up with far more nominations confirmed than they ever would have,” he said.

Sen. Benjamin L. Cardin (D-Md.) said that he was “pleased” that Democrats would be able to confirm several more nominees. “It’s inconvenient to be here voting around the clock. But at least we get our work done,” he said.

The 1,603-page spending agreement will fund most of the federal government until the end of the fiscal year in September. But it funds the Department of Homeland Security only until the end of February, setting up a fight with the Obama administration in the coming weeks over the future of the nation’s immigration policy.

In addition to authorizing $1.1 trillion in federal spending, the bill includes restrictions on the District of Columbia as it attempts to legalize the possession of marijuana. The legislation also weakens some Wall Street regulations and loosens campaign donation limits so that wealthy couples could give three times the maximum to the national political parties.

The afternoon vote-a-thon meant that senators had the rare opportunity to be in one another’s presence over several hours on the Senate floor. Republicans snacked on Chick-fil-A sandwiches provided for them in the GOP cloakroom, while several Democratic senators were spotted in line at a basement sandwich shop where they rarely, if ever, order food.

Reid spent most of the day at his lectern, calling for votes, batting away GOP attempts to derail the votes and conferring with aides and other senators. He had brief words with Cruz as the Texan tried to secure time for his amendment but held what appeared to be a jovial conversation with Sen. Rand Paul (R-Ky.), one of his leading GOP critics.

Senate leaders have often used the threat of weekend sessions to speed along debate but have rarely called colleagues in for Saturday or Sunday votes. Reid’s tenure has been marked by sporadic weekend sessions, from the December 2009 health-care fight to the December 2012 “fiscal cliff” showdown.

Even after completing work on the spending bill, Reid and McConnell still need to determine how to proceed on legislation authorizing a package of tax breaks and whether to use a House-passed bill to reauthorize a federally backed terrorism insurance program, or try forcing the House to reconvene and pass a Senate-approved proposal that House conservatives oppose.

Failure to quickly resolve differences means that senators could be in session until at least Wednesday.

Paul Kane contributed to this report.