Mr. Ryan, chairman of the House Budget Committee, and Speaker John A. Boehner worked behind the scenes to win support from Senate Republicans.

And with a public showdown looming, undecided Republicans opted on Monday to get off the fence. Even some Republicans who had privately signaled opposition last week were coming around, convinced a deal that passed the House 332-94, with a strong majority of Republicans behind it, could not be derailed in the Senate.

“Much more work needs to be done to address the No. 1 drivers of our country’s debt — our entitlement programs. But my hope is that this budget agreement paves the way to greater stability, lasting deficit reduction, and the political will to tackle those challenges in the near future,” Mr. Hatch wrote in a statement.

Under the budget deal, spending on defense and nondefense programs would rise from the $967 billion slated for this fiscal year to $1.012 trillion, mitigating the impact of across-the-board spending cuts and allowing congressional lawmakers to draft detailed spending plans for the first time in several years. Spending in fiscal 2015, which begins Oct. 1, would rise from $995 billion to $1.014 trillion. Though total spending would rise $63 billion over 10 years, the measure would trim the deficit slightly.

Opponents had initially seized on the notion that immediate spending increases would be more than offset by savings spaced over 10 years, with much of those savings in 2021 and 2022. But some Senate Republicans have now pinned their opposition to $6 billion in cuts to military pensions — cuts that have incensed some veterans groups.

Senators Kelly Ayotte of New Hampshire, Lindsey Graham of South Carolina and Roger Wicker of Mississippi, all Republicans, will bring military families to the Senate on Tuesday to protest the cuts. Senator Jeff Sessions of Alabama, the ranking Republican on the Senate Budget Committee, complained of “a real hit to military retirements,” and said the measure did not do enough to reduce the deficit.

But Mr. Ryan has defended the cuts as extremely modest. Under the plan, veterans of working age would see the cost-of-living increases to their pensions trimmed by 1 percent until age 62. At that point, their pensions would get a one-time boost so that payments during retirement would be the same as if there had been no cuts.