The House and the Senate are expected to vote Thursday on a long-term spending deal, hoping to end the repeated drama of short-term funding bills that have occupied Congress for much of the past five months.

The measure, which was hammered out between the Republican and Democratic Senate leaders, is expected to pass the Senate, but it faces some stiff opposition from members of both parties in the House.

Sen. Bob Corker announced his opposition to the bill Thursday, calling it a "massive spending agreement."

“This agreement increases the discretionary spending caps by nearly $300 billion over the next two years, perpetuates the abuse of OCO, and tees up another spending battle two years from now. It is also only partially offset, and most of those offsets occur years from now, doubling down on the irresponsible mentality in Congress of spend-now-pay-later. To say I am discouraged by the outcome of these negotiations would be an understatement.”

Both chambers have until midnight tonight to act before government funding stops. If it passes, the two-year spending deal completes months of haggling between the two parties on a variety of issues that have resulted in five incremental spending bills and a three-day government shutdown.

Budget writers worked almost around the clock this week to reach a deal that was finalized just after 11:00 p.m. Wednesday.

It would increase domestic spending by $131 billion and defense spending by $165 billion over the next two years, provide nearly $90 billion in disaster aid and extend the debt limit for one year – until well after the midterm elections.

Republicans are praising the increase in military spending while Democrats are hailing an increase in domestic, a tonic that might be enough, along with the desire to avoid a second government shutdown in one month, to garner enough votes.

The addition of disaster relief brought Sen. Ted Cruz, R-Texas, who often votes against spending bills, on board.

"This latest disaster relief bill is the next step in our State’s road to recovery," Cruz said in a statement. "And I am gratified that (Sen.) John Cornyn, (R-Texas,) and I have been able to build upon and improve the bill that was sent to us by the House of Representatives to give the state of Texas the resources it desperately needs."

What the measure doesn’t address is the Deferred Action for Childhood Arrivals program, or DACA. The Senate will take up the issue next week.

But the issue’s absence is reason for Democrats in the House, including Leader Nancy Pelosi to oppose the measure. She spoke for more than eight hours on the House floor Wednesday in support of Dreamers, immigrants brought to the U.S. by their parents as children.

But notably, and perhaps a good sign for the prospects of the legislation, Pelosi said she would not implore her caucus to vote against it.

“I am just telling people why I am voting the way I am voting,” Pelosi said at a news conference Thursday morning.

Conservative Republicans are also in opposition because of the major increases to domestic spending.