WASHINGTON - Congress cleared a $1.1 trillion spending bill late Saturday night for President Obama's signature after a day of Senate intrigue capped by a failed, largely symbolic Republican challenge to the administration's new immigration policy.

The vote was 56-40 in favor of the bill, which funds nearly the entire government through the Sept. 30 end of the fiscal year. It also charts a new course for selected shaky pension plans covering more than 1 million retirees, including the possibility of benefit cuts.

The Senate passed the bill on a day when Democrats launched a drive to confirm two dozen of Obama's stalled nominees to the federal bench and administration posts before their majority expires at year's end.

Several Republicans blamed tea party-backed Texas Sen. Ted Cruz for giving Democrats an opportunity to seek approval for the presidential appointees.

Cruz had pushed the Senate to cast its first vote on the administration's policy of suspending the threat of deportation for an estimated 4 million immigrants in the country illegally. The vote failed, 74-22, Saturday night, though Republican leaders have vowed to bring the issue back after the party takes control of the Senate in January.

"If you believe President Obama's amnesty is unconstitutional, vote yes. If you believe President Obama's amnesty is consistent with the Constitution, vote no," he said.

Senate Majority Leader Harry Reid rebutted instantly, saying Cruz was "wrong, wrong, wrong on several counts," and even Republicans who oppose Obama's policy abandoned the Texan.

The spending bill, which cleared the House on Thursday, was the main item left on Congress' year-end agenda, and it exposed fissures within both political parties in both houses.

It faced opposition from Democratic liberals upset about the repeal of a banking regulation and Republican conservatives unhappy that it failed to challenge Obama's immigration moves.

The legislation assures funding for nearly the entire government until next fall, but it made an exception of the Department of Homeland Security. Money for the agency will run out on Feb. 27, when Republicans intend to try to force the president to roll back an immigration policy that removes the threat of deportation for millions of immigrants in the United States illegally.

The legislation locks in spending levels negotiated in recent years between Republicans and Democrats, and includes a number of provisions that reflect the priorities of one party or the other, from the environment to abortion to the legalization of marijuana in the District of Columbia.

One, which drew vehement objections from Democrats, would repeal a regulation imposed on banks after the near-economic collapse of 2008. Critics called it a bailout for large financial institutions, but more than 70 House Democrats voted for it previously, and Obama made clear he didn't view it as a deal-killer.

The pension provision was a bipartisan agreement that opens the door for the first time to benefit cuts for current retirees covered by multi-employer funds in shaky financial condition.

Supporters said it would protect retirement income to the maximum extent possible without endangering the solvency of the government fund that guarantees multi-employer plans. Critics said it posed a threat to pension recipients and could set a precedent for other pensioners.