Updated

Republican and Democratic Senate leaders announced a budget agreement Wednesday that includes a big boost in spending for the Pentagon and would keep the government running past a looming deadline.

“I am pleased to announce that our bipartisan, bicameral negotiations on defense spending and other priorities have yielded a significant agreement,” Senate Majority Leader Mitch McConnell said in a floor speech.

Senate Democratic Leader Chuck Schumer said, “We have reached a budget deal that neither side loves, but both sides can be proud of.”

Congress has until Feb. 8 to pass a spending bill, and the deal would fund the government through March 23. While Congress would still have to pass another spending measure before that deadline, the agreement announced Wednesday includes a longer-term pact to lift spending caps by roughly $400 billion for Pentagon and domestic programs over two years.

"The Budget Agreement today is so important for our great Military," President Trump tweeted Wednesday. "It ends the dangerous sequester and gives Secretary Mattis what he needs to keep America Great. Republicans and Democrats must support our troops and support this bill!"

Defense Secretary James Mattis said Wednesday he was encouraged by the deal.

“I'm heartened that Congress recognizes the sobering effect of budgetary uncertainty on America's military and on the men and women who provide for our nation's defense,” Mattis said during the White House briefing.

White House press secretary Sarah Sanders also expressed optimism about the deal, though wouldn’t explicitly say whether the president would sign the agreement if passed.

“Look, we applaud the steps forward that they have made, but we're going to need to see what is in the final bill. We are certainly happy with the direction that it's moving, particularly that we're moving away from the crisis budgeting that we have been on in the past,” she said.

McConnell said the measure would rewrite existing defense limits that have "hamstrung our armed forces and jeopardized our national security."

The bill removes automatic spending cuts – known as sequestration caps – for both defense and nondefense programs. The caps were put in place in 2011 as part of the Budget Control Act to lift the debt limit.

The deal would lift the debt limit and also includes disaster relief for hurricane-stricken areas as well as a four-year extension of the Children's Health Insurance Program (CHIP).

The agreement, though, does not tackle immigration -- at a time when Congress is debating how to address those affected by the looming expiration of former President Barack Obama's Deferred Action for Childhood Arrivals program, or DACA. The program gave a deportation reprieve to young illegal immigrants who came to the U.S. as children.

McConnell has committed to a freewheeling debate on immigration if the Senate is still open after Feb. 8.

The House of Representatives on Tuesday night approved their version of a stopgap spending bill to run the government through March 23 and bolster defense funding.

The House's top Democrat swung out against the latest plan.

House Minority Leader Nancy Pelosi of California announced she would oppose the budget measure unless her chamber's GOP leaders promised a vote on legislation to protect "Dreamer" immigrants.

Fox News' Chad Pergram and The Associated Press contributed to this report.