WASHINGTON - Time running short, Republicans and Democrats agreed Tuesday on a $1.1 trillion spending bill to avoid a government shutdown and delay a politically charged struggle over President Obama's new immigration policy until the new year.

In an unexpected move, lawmakers also agreed on legislation expected to be incorporated into the spending measure that will permit a reduction in benefits to current retirees at economically distressed multiemployer pension plans. Supporters said it was part of an effort to prevent a slow-motion collapse of a system that provides retirement income to millions, but critics objected vehemently.

Officials said final details of the sweeping bill to fund the government would be available later Tuesday, after it was posted online.

"The federal government's going to run out of money in two days. ... We've been trying to work with Republican leaders to avoid a shutdown," Senate Majority Leader Harry Reid of Nevada said at midafternoon as final negotiations dragged on.

Speaker John A. Boehner (R., Ohio) said he hoped for a vote on the measure on Thursday, and officials expressed confidence they could overcome opposition from tea party-backed Republicans and avoid a government shutdown.

Senate approval would then be required to send it to Obama - one of the final acts of a two-year Congress far better known for gridlock than for accomplishment.

Not only a two-year Congress, but also a political era was drawing to a close as the lights burned late inside the Capitol on a December night.

For the first time in eight years, Republicans will have a Senate majority in January after a hugely successful midterm election, and newly elected GOP senators-elect participated in closed-door strategy sessions during the day.

Before time runs out on his majority, Reid said he wanted to assure confirmation of nine more of Obama's judicial nominees and approve the appointment of Vivek Murthy as surgeon general.

Also on Congress' must-do list is legislation to renew a series of expiring tax breaks, and a bill to authorize the Pentagon to train and equip Syrian rebels to fight Islamic State forces.

The compromise spending bill will permit virtually the entire government to operate normally through the Sept. 30 end of the fiscal year.