Getting the $1.01 trillion spending bill through Congress before midnight on Dec. 11 may prove difficult, so House GOP leaders are preparing to pass a short-term extension to give the Senate more time. (Jim Lo Scalzo/EPA)

Congressional leaders unveiled a massive $1.01 trillion spending bill Tuesday night that will keep most of the federal government funded through September.

The legislation is expected to pass in the coming days and will allow the incoming Republican-controlled Congress to clear the decks of lingering spending issues while setting the stage for a prolonged fight with President Obama over immigration policy.

At 1,603 pages, the bill includes at least $1.2 billion for agencies to deal with the influx of unaccompanied immigrant children who crossed the U.S.-Mexico border. There’s also money to fight the rise of the Islamic State and $5.4 billion to fight the threat of Ebola. But there are also significant changes to campaign finance laws and potential cuts to retiree pension plans. Democrats were cheering bigger budgets for enforcement at agencies created after the 2008 economic collapse.

House leaders are planning to introduce a stopgap bill to give the House and Senate a few more days to pass the final measure and avoid a government shutdown Thursday night. Extending current funding for a short period has happened before, but doing so this year will provide an embarrassing climax to one of the most fruitless congressional sessions in history.

“There’s no reason the government should shut down,” said Senate Majority Leader Harry M. Reid (D-Nev.). “And we’re ready to pass a year-long spending bill to take care of this.”

A $1 trillion spending bill unveiled Tuesday keeps most of the federal government funded through September. Here, the Post's Ed O'Keefe points out a few of the most notable components of the legislation. (Davin Coburn/The Washington Post)

John Thune (S.D.), the third-ranking Republican senator, joked that last-minute drama with the spending plan “is a Christmas tradition.” But, he added, “I don’t see it getting derailed. I think it could get slowed down, but I think it will ultimately get across the finish line.”

The White House had not indicated by late Tuesday whether it supported the bill.

The agreement hews to spending caps that lawmakers and the White House agreed to last year. It includes $521 billion in military spending and $492 billion for other federal agencies. An additional $64 billion would be set aside for overseas military operations, including the fight against the Islamic State and to assist European countries facing Russian aggression.

The legislation would provide full funding for 11 of the 12 appropriations bills Congress is supposed to pass each year. But Republicans insisted on a shorter funding schedule for the Department of Homeland Security, which has jurisdiction over immigration enforcement. The sprawling department will get money only through February, giving Republicans more time to craft a legislative response to Obama’s decision to use his executive authority to change immigration policy.

But federal dollars also would be spread to other agencies to help address the rise in immigration, which is likely to infuriate conservative lawmakers seeking to cut funding for immigration programs.

The Department of Health and Human Services would receive $948 million to provide health and education services to the unaccompanied children — an $80 million increase. An additional $14 million would be provided to help school districts dealing with an influx of immigrant students. And the State Department would receive $260 million to aid the Central American countries where most of the young migrants are coming from.

Sen. Barbara A. Mikulski (D-Md.) and Rep. Harold Rogers (R-Ky.), who led the talks as leaders of the Senate and House appropriations committees, called the bill a fair deal.

“While not everyone got everything they wanted, such compromises must be made in a divided government,” they said in a statement.

The bill is packed with policy instructions, called “riders,” that were the subject of months of discussions between Democrats and Republicans.

One of the most notable changes includes dramatically expanding the amount of money that wealthy political donors could give the national parties, drastically undercutting the 2002 landmark McCain-Feingold campaign finance overhaul. Top donors would be allowed to give three times the annual cap on national party donations to three additional party committees set up for the purposes of the presidential conventions, building expenses and election recounts.

For the first time, Congress also would allow the benefits of current retirees to be severely cut, part of an effort to save some of the nation’s most distressed pension plans.

The bill authorizes a 1 percent pay raise for military service members and allows a 1 percent pay raise for federal employees, ordered by Obama, to begin in January. Lawmakers again banned or limited certain federal agency conferences and employee awards. The bill also ends a 5 percent discount on tobacco products sold at military exchanges.

At domestic agencies, the EPA’s budget would be cut by $60 million, and the IRS would lose $345.6 million. The nation’s tax agency also would be banned from targeting organizations seeking tax-exempt status based on their ideological beliefs.

Aaron Davis, Michael Fletcher and Matea Gold contributed to this report.