This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

The Senate approved a $1.1 trillion spending measure Saturday night funding most of the government through September, removing the threat of a shutdown for much of 2015.

The bipartisan 56-40 vote sends the bill to President Barack Obama, who is expected to sign it into law.

Passage closes a chapter of yet another fiscal battle on Capitol Hill. It came after attempts to delay the legislation by liberals who sought to strip out a policy provision that eases a Wall Street regulation and conservatives who tried to slow action on immigration.

In fact, the Senate would not have been in session this weekend if it hadn’t been for a small band of conservatives who sabotaged an agreement by Democratic Leader Harry Reid and Republican Leader Mitch McConnell, who wanted to vote on the bill Monday.

In a late Friday night procedural sneak attack, carried out after McConnell left the Capitol, the group led by Sen. Ted Cruz, R-Texas, forced the Senate to stay. They also pressed to get a vote on a measure to declare the bill unconstitutional because it funds what they say is “illegal amnesty” included in the President’s recent executive orders on immigration.

The move by rank-and-file members to undermine an agreement between the Senate leaders is highly unusual and may reflect the difficulty incoming majority leader McConnell will face managing the Senate when the new Congress convenes next month.

Cruz defended his actions.

“Every Republican candidate all across the country said we’ll do everything humanly possible to stop President Obama’s illegal amnesty. We’re honoring those commitments,” Cruz said as he shuttled between strategy sessions in the Capitol with his cohorts Sen. Mike Lee of Utah, Sen. David Vitter of Louisiana, and Sen. Jeff Sessions of Alabama.

“They’re going to get nothing out of this,” said Sen. Tom Harkin, D-Iowa, who, like a lot of senators, was frustrated by Cruz’s tactics and predicted he would not succeed in scuttling the bill. “This is absolute utter nonsense for us to be here.”

Cruz ultimately did receive a vote challenging the funding bill because it included money for the Department of Homeland Security, which is carrying out the President’s recent executive actions on immigration. Cruz and other Republicans say the President’s orders are unconstitutional.

Though his challenge failed, the senator wanted a vote to “ensure that every senator will be on record regarding the constitutionality of President Obama’s illegal amnesty,” Catherine Frazier, Cruz’s press secretary, emailed reporters early Saturday ahead of the vote.

Democrats took advantage of the Saturday session to begin procedure votes on 24 nominations, including some controversial ones like Sarah Saldaña for director of U.S. Immigration and Customs Enforcement, Vivek Murthy for surgeon general, and Carolyn Colvin for commissioner of the Social Security Administration.

A senior Democratic leadership aide said some of the nominees would most likely have not received a vote because of timing and senators leaving for the holidays.

“We gave away literally nothing, and we got a number of nominees we would not have been able to confirm if we hadn’t been in session today,” the aide said.

Before the unusual weekend session, much of the drama over the spending bill was in the House, where Republican Speaker John Boehner and Obama formed an unusual alliance to quell their own parties’ rebellions — led on the left by Minority Leader Nancy Pelosi, D-California, and Sen. Elizabeth Warren, D- Massachusetts.

All the maneuvering was an ominous sign of what’s to come now that this Congress is wrapping up its work and a new one is set to start in January. Boehner and soon-to-be Senate Majority Leader McConnell are still struggling to rein in tea party conservatives who are itching for more showdowns over Obama’s immigration policies, the health care law, the debt ceiling and more.

And Democrats who had been loyal to Obama now find they no longer need the President, especially since many of the party’s more centrist members lost their seats in a midterm election that saw Republicans gain control of the Senate and expand their advantage in the House.

“This by definition was a compromise bill. This is what is produced when you have a divided government that the American people voted for,” Obama told reporters Friday. “Had I been able to draft my own legislation, get it passed without any Republican votes, I suspect it would be slightly different,” he said.

“That is not the circumstance we find ourselves in and I think what the American people very much are looking for is responsible governance and the willingness to compromise, and that’s what we’ve clearly done,” Obama added.

Beyond keeping the government open, the spending bill includes dozens of far-reaching policy provisions. It blocks a voter-approved law in the District of Columbia, that legalizes marijuana and blunts a school lunch program championed by first lady Michelle Obama.