The Senate passed a sweeping $1.1 trillion spending package Saturday night to stave off a government shutdown after days of high drama, legislative maneuvers, and an unusual weekend session that put the Republicans' most conservative members at odds with their own party.

Senate conservatives, led by Ted Cruz and Mike Lee, tried to use the legislative process to protest President Obama's executive action on immigration. But they angered their fellow Republicans when the only result of their gambit was Senate Democrats getting what they wanted before power changes hands to Republicans next month.

The spending legislation, known as the "cromnibus," will fund most of the government through September, with the exception of the Department of Homeland Security, which will run out of funds in February. The bill passed by a bipartisan vote of 56 to 42, including 24 Republicans in support. It now goes to Obama, who is expected to sign it.

Not only was Cruz unable to stop the spending package, but by day's end he had annoyed Democrats and Republicans alike.  

"You should have an end goal in sight if you're going to do these types of things and I don't see an end goal other than irritating a lot of people," said Republican Senator Orrin Hatch of Utah.

"I don't see what we’re achieving here," added Senator Jeff Flake, an Arizona Republican.

But Cruz, who is mulling a run for president in 2016, revels in presenting himself as an outsider. "Both Democrats and Republicans will have the opportunity to show America whether they stand with a president who is defying the will of the voters or with the millions of Americans who want a safe and legal immigration system," Cruz said to the Senate chamber before the vote.

Senate Majority Leader Harry Reid responded that the "junior senator from Texas" was "wrong, wrong, wrong."

Reid and his Republican counterpart, Minority Leader Mitch McConnell, had worked out an agreement Friday to hold a vote on the spending package on Monday. But Cruz's last-minute procedural maneuver to demand a vote on immigration scuttled that deal and forced senators to stay in Washington for the weekend. Not only did the immigration vote fail by a wide margin, 74-22, but the maneuver allowed Democrats to advance a slate of two dozen Obama nominees  to executive branch positions faster than they otherwise would have proceeded.

The nominations include Tony Blinken as deputy secretary of state, Dr. Vivek Murthy as surgeon general, Sarah Saldana as head of Immigration and Customs Enforcement and Carolyn Colvin to lead the Social Security Administration. These, in addition to several judicial appointments, are expected to begin processing on Monday.

"It will have the end result of causing nominees who I think are not well qualified to be confirmed, so I don't understand the approach that he is taking," Republican Susan Collins of Maine told The New York Times. "And I think it's very unfortunate and counterproductive."

However, Cruz insisted that it was Reid who was to blame for drawing out the process. In a Facebook post, Cruz said Reid was "going to an embarrassing length to tie up the floor to obstruct debate and a vote on this issue because he knows amnesty is unpopular with the American people, and he doesn't want the Democrats on the record as supporting it."

Last fall, Cruz and Lee were among those who led a partial shutdown of the government in an effort to defund the Affordable Care Act—a move that many of their Republican colleagues condemned even as some on the right cheered it.

To Democrats, the conservatives' ploy was nothing more than a publicity stunt. "They're all about headlines," said Democrat Chris Murphy of Connecticut. "They're trying to get attention for themselves. They've succeeded in doing that."