The deal would give Mr. Trump military bragging rights. “The bottom line is that, thanks to President Trump, we can now have the strongest military we have ever had,” the White House press secretary, Sarah Huckabee Sanders, said on Wednesday.
At least for now, it could put an end to the fiscal crises that Mr. Trump has at times seemed to welcome.
Nonetheless, the president threw his weight behind the accord, writing on Twitter, “Republicans and Democrats must support our troops and support this Bill!”
If the deal passes on Thursday, lawmakers would then put together a long-term spending package over the coming weeks that would fund the government through September, granting a measure of peace to Washington as attention turns to the midterm elections in November. Heading into the midterm elections, it would also enable lawmakers to go home and claim success at delivering funding for pressing needs, like fighting the opioid epidemic.
By setting overall spending levels through September 2019, the deal would ease passage of spending legislation in the next fiscal year, as well.
The agreement will cause federal budget deficits to grow even larger, on top of the effects of the sweeping tax overhaul that lawmakers approved in December. But because the deal gives long-sought victories to both parties, the deficit effect appears to be of little concern. Defense Secretary Jim Mattis and Speaker Paul D. Ryan of Wisconsin both quickly embraced it.
From the increase in domestic spending, Mr. Schumer said the deal includes $20 billion for infrastructure, $6 billion for the opioid crisis and mental health, $5.8 billion for child care and $4 billion for veterans hospitals and clinics. In addition, the deal includes almost $90 billion in disaster relief in response to last year’s hurricanes and wildfires.
The agreement includes an additional four-year extension of funding for the Children’s Health Insurance Program, on top of the six-year extension that Congress approved last month.
The deal also lifts the debt limit until March 2019, pushing any future confrontation over that issue until after the midterm elections. The Congressional Budget Office recently projected that the Treasury would probably run out of cash in the first half of March if the limit were not raised.
“I hope we can build on this bipartisan momentum and make 2018 a year of significant achievement for Congress, for our constituents and for the country that we all love,” Mr. McConnell said.
Mr. Schumer was similarly effusive. “After months of legislative logjams, this budget deal is a genuine breakthrough,” he said. “After months of fiscal brinkmanship, this budget deal is the first real sprout of bipartisanship.”
Mr. Ryan urged his members to vote for it: “America will be safer and stronger because of this agreement.” His embrace boosted its chances in the House, where conservatives were cool to it, if not hostile.
Hard-line conservatives were unsparing in their assessment.
“This is a dead-end path that will cause great hardship to Americans,” proclaimed Representative Mo Brooks, Republican of Alabama. “And if you really look it out long term and see the cascading effects, it is going to cost a lot of Americans their lives.”
Senator Mike Lee, Republican of Utah, called the deal “a betrayal of everything limited government conservatism stands for.”
The agreement also incited opposition from Ms. Pelosi, who said she could not agree to any budget deal that was not accompanied by a promise to vote on legislation in the House to protect young immigrants brought to the country illegally as children, or “Dreamers.”
“Without that commitment from Speaker Ryan, comparable to the commitment from Leader McConnell, this package does not have my support, nor does it have the support of a large number of members of our caucus,” Ms. Pelosi said on the House floor, where she delivered a marathon speech about Dreamers that stretched for more than eight hours.
She was referring to a promise by Mr. McConnell to begin debate on immigration soon, a commitment not matched by Mr. Ryan. But Mr. Ryan did not rush to offer the assurance that Ms. Pelosi sought.
“Speaker Ryan has already repeatedly stated we intend to do a DACA and immigration reform bill — one that the president supports,” a spokeswoman for Mr. Ryan, AshLee Strong, said, referring to the Obama-era program that shields Dreamers from deportation known as Deferred Action for Childhood Arrivals, or DACA.
The budget deal would be paired with a stopgap spending measure that would keep the government open past Thursday, when the current funding measure is set to expire. Lawmakers would then have six weeks, until March 23, to pass a long-term funding package.
The Senate was expected to vote on the deal on Thursday, with the House to follow afterward. It was not clear if enough Democrats would oppose the deal to imperil its passage in the House, given the likely opposition from at least some fiscal conservatives. If lawmakers cannot pass a temporary funding measure by the end of Thursday — either tied to the budget pact or by itself — the government would shut down for the second time this year.
Only on Tuesday, Mr. Trump was trying to engage in fiscal brinkmanship, threatening another government shutdown if his hard-line demands on immigration were not met.
“I’d love to see a shutdown if we don’t get this stuff taken care of,” Mr. Trump said then. “If we have to shut it down because the Democrats don’t want safety,” he added, “then shut it down.”
But budget negotiators seemed to pay him little heed.
“While President Trump threatens shutdowns and stalemates, congressional leaders have done the hard work of finding compromise and consensus,” Mr. Schumer said. He added, “At the end of the day, I believe we have reached a budget deal that neither side loves, but both sides can be proud of.”
The deal had eluded negotiators for months, as it became intertwined with delicate negotiations on other matters, particularly the contentious issue of immigration.
But after last month’s three-day government shutdown, Senate Democrats were willing to finalize a budget deal separately from the debate over immigration.
The deal made for another lonely day for lawmakers concerned about the budget deficit, which was already expected to reach $1 trillion in the next fiscal year, according to the Committee for a Responsible Federal Budget, a fiscal watchdog group.
The tax overhaul is projected to add $1.5 trillion to the deficit over a decade, and the budget agreement will balloon the deficit even further.
“This deal represents budgeting at its worst — each party is giving the other its wish list with all the bells and whistles included and asking future generations to pick up the tab,” said Maya MacGuineas, the president of the watchdog group.
The deal drew scorn from conservative groups angered by the big increase in spending.
Jason Pye, the vice president of legislative affairs for FreedomWorks, said the deal “isn’t just fiscally irresponsible, it’s an abomination.”
“No one in Congress who claims that they’re a deficit hawk or a fiscal conservative can justifiably vote for this deal,” he said.