Story highlights House and Senate negotiators announced a funding agreement late Tuesday

Congress must pass a spending bill by Thursday to avoid a shutdown

Lawmakers had been haggling over policy rather than funding issues

Negotiators on House and Senate spending panels agreed to $1.1 trillion government funding bill, they announced Tuesday, just two days before federal agencies are due to run out of money.

JUST WATCHED How to avoid a government shutdown Replay More Videos ... MUST WATCH How to avoid a government shutdown 02:24

JUST WATCHED Will Ted Cruz shut down the government? Replay More Videos ... MUST WATCH Will Ted Cruz shut down the government? 02:36

JUST WATCHED Is a government shutdown in the future? Replay More Videos ... MUST WATCH Is a government shutdown in the future? 01:59

As part of the spending bill Democrats and Republicans have also agreed to attach policy provisions on a range of issues -- including measures to roll back environmental regulations, rules for possession of marijuana in the District of Columbia, and changes to financial regulations for banks.

"This bill fulfills our constitutional duty to fund the government, preventing damage from shutdown politics that are bad for the economy, cost jobs and hurt middle class families," said Maryland Sen. Barbara Mikulski, a Democrat, and Kentucky Rep. Hal Rogers, a Republican, in a joint statement. "While not everyone got everything they wanted, such compromises must be made in a divided government. These are the tough choices that we must make to govern responsibly and do what the American people sent us here to do."

The spending measure, which would fund most of the government for a full fiscal year was expected to be released at the beginning of the week. But on Tuesday evening, lawmakers continued to haggle over everything from immigration to terrorism risk insurance. The squabbling increased the chances that Congress will have to approve a short-term bill on Thursday to keep the government open for just a few days and give lawmakers a little more time to finalize a deal.

But the last-minute agreement avoids that outcome, and likely means the government will remain open for business as usual.

Senate Democratic Leader Harry Reid told reporters on Tuesday, "We're ready to pass a yearlong spending bill to take care of this. We've been trying to work with Republican leaders to avoid a shutdown. There is going to come a time when they are going to have to take 'yes' for an answer. I guess they are not there yet."

A House vote on the spending bill now is expected hours before the deadline on Thursday night, which would give the Democratic-led Senate little time to debate and vote on the legislation before government operations would be interrupted by a funding gap.

The House Appropriations committee unveiled their legislation late Tuesday night, which funds virtually all of the government for a full fiscal year. But in response to the President Barack Obama's action on immigration, it only provides resources for the Department of Homeland Security through the end of February.

Even that doesn't go far enough for some conservatives who want to use the annual spending bill to strip funding for the implementation of the executive orders. They insist that exercising Congress' power of the purse was the best tool to use now, instead of waiting to wage the fight until next year.

"I think it's a punt," Arizona GOP Rep. Matt Salmon told reporters about the current House spending proposal. He predicted as many as 50 House Republicans would oppose the legislation, but said in the end, those defections wouldn't block the bill because enough Democrats would back it to avoid a shutdown.

Reid and other Senate Democrats have already said they would accept the hybrid bill so long as it didn't contain poison pill policy riders. Reid's comments Tuesday reflect that he is concerned some of those riders remain in the bill.

House Speaker John Boehner and Senate GOP Leader Mitch McConnell have been urging Republicans to postpone their effort to roll back the President's executive actions until next year when they control both the House and the Senate. GOP leaders have repeatedly told members they don't want to risk a repeat of last fall's government shutdown, which most voters blamed on the GOP.

The House passed a bill last week designed to stop the President's executive order, but that measure was seen as largely symbolic -- even from its supporters -- because the Democratic-led Senate refused to hold a vote on it and the Obama administration threatened to veto it. While GOP leaders argue it's better to wait until next year when they have control of both chambers of Congress, there is no plan in place for what Republicans will actually do in 2015.

Flores said he was still waiting to read the spending bill, but he agreed with the concept of separating the immigration fight from the spending bill. He said for now, the Democratic-led Senate limits the options in the face of a shutdown and "hopefully in January we're going to have a bigger tool box" to force the Administration to revise its policies on immigration.

Last minute discussions about unrelated legislation held up the funding bill's introduction, including whether to add an unrelated terrorism risk insurance measure to the measure. Discussions over that issue led to a fight over financial regulations -- a sign the debate over the spending bill had drifted off its initial course.

House Democratic leaders won't say how they will vote on the measure, but the number two Democratic leader told reporters on Tuesday that Republicans will find it easier to attract support if they leave out controversial policy provisions.

"The cleaner this bill is the more likely it is of its passage," said Rep. Steny Hoyer of Maryland.