Twenty-four of 42 GOP senators, including all the GOP leaders, backed the $1.1 trillion 2015 budget that also funds President Barack Obama’s unilateral amnesty.

The Senate’s 56-to-40 vote came as outgoing Democratic Majority Leader Sen. Harry Reid used the broad GOP opposition to the Obama’s amnesty to split the GOP into two factions.

That 20-to-22 split came late Saturday, when Republicans finally had a chance to vote for or against Obama’s amnesty.

The vote was engineered by Sen. Ted Cruz, who filed a “Point of Order” claim that required the senators to say if they thought the budget bill was constitutional despite not defunding Obama’s amnesty. Unless negated by judges, the amnesty is expected to provide five million migrants with work permits to let them compete for legal jobs against Americans, to put many illegals on a fast-track to citizenship, and to prevent the repatriation of nearly all 12 million migrants in the United States.

Twenty-two GOP senators used the Cruz opportunity to say the amnesty is unconstitutional, and three GOP senators were absent.

The remaining 20 Republican senators said the budget bill was constitutional, even if Obama’s amnesty is not.

The group of 20 senators, however, included many who dislike Cruz, and several angered by Reid’s decision to hold a series of Saturday votes. Reid’s decision forced GOP senators to cancel travel plans and miss planned parties. He skillfully steered that anger toward Cruz, sharply reducing his total votes down to 22, a Senate aide told The Daily Caller.

“Senators are so mad at Cruz right now… the subject of the Cruz amendment was Cruz,” not the amnesty, the aide said.

More than 22 GOP senators are opposed to the amnesty, and others are ambivalent, even though the GOP leadership — and several senators —- are quietly backing the amnesty, he said.

“A lot of members are casually going along with this” anti-Cruz mood, he said. But “they’re easily flippable into the [anti-amnesty] fight” when they feel pressure from constituents, he said.

The anti-Cruz mood was spotlighted by pro-amnesty South Carolina Sen. Lindsey Graham. He voted against Cruz’s measure, and later he tweeted out thinly veiled criticism of Cruz.

“Some of the tactics employed today will result in numerous Obama nominees – previously blocked – to end up being confirmed… I haven’t seen Harry Reid smile like this in years,” said Graham, who actually kick-started the Senate’s bitter 2013 immigration debate in December 2012 by teaming up with New York Democratic Sen. Chuck Schumer.

The Cruz voted took place just before the major budget vote, which split 56 to 40.

Twenty-four GOP senators backed the amnesty-funding budget bill, including Sen. Mitch McConnell. During his recent election in Kentucky, a pro-McConnell group said his opponent would support amnesty.

Since at least 2006, Democrats have said they will oppose business’s demand for extra foreign workers unless the foreign workers are allowed to vote in future elections. Obama’s amnesty include work permits and a fast-track to citizenship for five million migrants. He’s also telling an additional seven million illegals, plus people who overstay their work-visas, that he won’t repatriate them unless they commit major crimes or pose a national security threat.

The vote came two days after the GOP leadership team in the House steamrolled opposition from 67 GOP legislators, and pushed through a budget that allows funding for Obama’s unpopular amnesty. Speaker of the House John Boehner’s win came after Obama helped persuade 56 Democrats to vote for the budget, and despite many protest calls from GOP voters.

On Saturday, 18 of 45 GOP senators voted against the budget bill, mostly because it did not block funding for the Obama’s unilateral and unpopular amnesty.

A growing number of GOP legislators oppose the worker-inflow as unfair to Americans, whose median wages have remained flat since 2000. But some of the no votes came from amnesty supporters, including Sen. John McCain and Sen. Jeff Flake.

Twenty-one of 54 attending Democratic senators voted against the budget bill, largely because of a campaign finance provision denounced by GOP Sen. David Vitter and Democratic Sen. Elizabeth Warren.

The 56 to 40 final score, however, is misleading. Routinely, many senators decided how to vote against a bill only after they learn it will pass. That timing allows them to posture as opponents of some measure in the bill, without risk any push-back from supporters of the bill. Had the bill’s final success come into doubt, some of the opposing senators likely would have changed to supporters under last-minute pressure.

During the Saturday debate, Reid used the debate pause required by Cruz’s vote accomplish a series of votes needed to advance Obama’s nominees to various political and judicial posts. Those weekend votes will allow him to stage final confirmation votes starting Monday.

Democrats and reporters who don’t like Cruz claimed his demand for a vote was a benefit for Democrats. In fact, Reid already planned to push the nominees through the Senate next week, and announced after the budget vote that he would be keeping the Senate in session next week.

“Senator Cruz’s stunt got two fewer votes than the 24 Obama nominees he helped Senate Democrats advance tonight,” said a Reid spokesman, according to a tweet by Buzzfeed reporter John Stanton.

National Journal’s Ron Fournier tweeted a series of taunts, “Cruz controlled…. Cruz shipped… Cruz whiner… Cruz to Nowhere.”

The GOP senators who voted against the Cruz point of order also includes senators who ran on an anti-amnesty platform in 2014, such as Sen. Lamar Alexander.

The list also includes senators who will face primary and general elections in 2016, such as Arizona Sen. John McCain, Illinois Sen. Mark Krik, and Indiana’s Sen. Dan Coats.

The senators who declared Obama’s move unconstitutional included Sens. Lee, Jeff Sessions, Rand Paul, Mike Crapo, Rob Portman, Pat Roberts, Marco Rubio, Tim Scott, David Vitter and Chuck Grassley. The group also included Sens. Roy Blunt and John Thune, who are members of the GOP’s leadership team.

But eight of the senators who voted for the Cruz measure also voted to help pass the 2015 budget, even though it does not bar funding for the amnesty. The switchers included Blunt and Thune.

Earlier during the debate, Reid scuttled an effort by Sen. Mike Lee to schedule a vote that could have barred funding for Obama’s amnesty.

Reid opposed the up-or-down Lee vote, in part because it would create a problem for some of the 46 Democratic senators in the future elections. Many polls show that Obama’s amnesty is unpopular, including among Democratic voters and in Democratic-dominated states.

Follow Neil on Twitter