The House passed legislation Tuesday to temporarily fund the government into late March, and provide full-year funding for the military.

But the spending battle isn't over, as the GOP bill passed along party lines, and now heads to the Senate, where lawmakers will likely reject it in favor of a bipartisan deal to fund the government for the rest of the fiscal year, and lift mandatory spending caps for two years.

The House-passed bill is the fifth short-term funding measure passed in fiscal 2018 and comes ahead of a Feb. 8 deadline, when the fourth temporary funding measure passed last month will expire. Lawmakers passed it 245-182 Tuesday evening.

House Republican leaders added full-year defense spending to the package upon the urging of Defense Secretary Jim Mattis, who told Republicans the stopgap spending cycles are damaging the military.

“This will ensure our nation’s defense, pay for our proud service men and women who will no longer be in jeopardy for ongoing decisions of funding for long-term spending caps,” said House Rules Committee Chairman Pete Sessions, R-Texas.

House Democrats voted against the bill.

They are awaiting the Senate accord on a broad spending measure which, according to Senate Minority Leader Chuck Schumer, D-N.Y., includes near-parity on defense and domestic spending increases, although defense is likely to get about $20 billion more than the domestic budget, according to some lawmakers.

“I am very hopeful that we can come to an agreement, an agreement very soon,” Schumer said Tuesday. “And it's an agreement I've discussed some of the outlines with my caucus that I think we are very happy with, and hopefully the Republicans are, and then we can get something really good done.”

House Democrats used the floor debate to pin the string of short-term bills on the GOP, who they accuse of failing to govern while controlling the majority in both chambers.

“The great government of the United States of America, that’s been called the last, best hope of man, cannot be funded in tranches of maybe two weeks to three weeks,” said Rep. Louise Slaughter, of New York, the top Democrat on the House Rules Committee.

The debate over spending comes as the two parties negotiate with great difficulty a deal to protect so-called Dreamers in exchange for border security and other immigration reforms, including an end to extended chain migration and the visa lottery system.

Democrats last month blocked the fourth government spending bill in an effort to force the GOP to include language to protect the Dreamers from deportation, but it largely backfired after it caused a three-day partial shutdown of government operations.

Democrats are now willing to ditch their immediate demands on the Dreamers and finish negotiating a broad spending package, which will end the need for short-term bills.

They are willing to back a spending deal because Senate Majority Leader Mitch McConnell, R-Ky., has promised he will bring an immigration bill to the floor next week and open it to amendments, which will give any proposal a chance to pass if it can win 60 votes.

The Senate would have to pass the broad spending package by Thursday in order to give the House enough time to pass it ahead of the midnight deadline, when current funding expires.

The Senate bill is likely to include provisions the House added to the measure it passed on Tuesday, including funding for community health centers and a score of provisions to bolster Medicare and Medicaid programs.

Senate Republicans and Democrats said it is also possible the broad deal will include an agreement to raise the nation’s borrowing limit, which expires in March, according to Treasury officials.

The House schedule is complicated by the Democrats’ planning retreat, which takes place beginning Wednesday on Maryland’s Eastern Shore, about a two-hour drive from the Capitol. Democrats will likely have to cut short their retreat and return Thursday night.