(Adds lawmaker comments, edits)
By David Lawder and Amanda Becker
WASHINGTON, Dec 13 (Reuters) - The U.S. Senate on Saturday passed a $1.1 trillion spending bill that lifts the threat of a government shutdown as Congress attempts to wrap up a two-year legislative session marked by bitter partisanship and few major accomplishments.
The Senate's 56-40 vote sends the measure to President Barack Obama, who is expected to sign it into law before federal spending authority expires at midnight on Wednesday.
Passage of the 1,603-page bill was a long, tough struggle in the Senate and the House of Representatives marked by bitter disputes over changes to banking regulations and Obama's recent executive order on immigration.
Liberal Democrats, led by Senator Elizabeth Warren, objected to a weakening of the Dodd-Frank financial reform law, while conservative Republicans, led by Tea Party firebrand Ted Cruz, tried to sink it for failing to stop Obama's order.
Cruz's tactics to delay the bill created an opening for Democrats in a rare Saturday session to push through dozens of Obama's nominations opposed by Republicans, from judges to energy regulators. His party colleagues were angered.
"I think most Republicans feel like that Christmas came early for Democrats," said Republican Senator Lindsey Graham. "At the end of the day, they got nominees we previously successfully blocked and we got nothing."
The legislation funds most government agencies through September 2015. The Department of Homeland Security will be treated differently, getting a funding extension only through Feb. 27, by which time Republicans will control both chambers of Congress.
Republicans insisted on the shorter leash for DHS so that they can try to deny the agency any funds for implementing Obama's recent order easing deportations for millions of undocumented immigrants.
The Senate vote closed the latest chapter in a four-year-long battle between Democrats and Republicans over U.S. fiscal policy during an era of large budget deficits.
These battles are expected to resume next year but with a twist: Republicans, having won big gains in the Nov. 4 congressional elections, take control of the Senate from Democrats with a 54-46 majority and will enjoy a larger majority in the House.
Nonetheless, Republicans will still need cooperation from Democrats in the Senate, where 60 out of 100 votes are needed to advance most major bills.
TEXAN STRIKES AGAIN
Cruz, a potential 2016 presidential candidate, had delayed the spending bill over demands for an up-or-down vote denying funds for Obama's immigration plans.