In their last vote of the year, 169 Republicans joined 163 Democrats in supporting the bill, while 62 Republicans and 32 Democrats voted against the agreement reached Tuesday by Rep. Paul Ryan, R-Wis., the chairman of the House Budget Committee, and Senate Budget Committee head Patty Murray, D-Wash.
Ryan said the vote margin was "much higher than I expected."
Some Democrats expressed displeasure regarding the lack of extended unemployment benefits, set to expire Dec. 28, in the bill and a GOP move to prevent a cut in fees paid to doctors.
Other lawmakers were unhappy over military retirement benefits cuts in the budget deal, which gives the Defense Department $32 billion in relief from sequester cuts in two years, the Hill said.
"The budget deal steps outside of its jurisdiction to find savings by targeting military retirees," said Sen. James Inhofe, R-Okla., ranking Republican on the Senate Armed Services Committee.
The budget also forces a cost-of-living adjustment for military retirees less than 62 years of age.
The Senate was expected to pass the budget bill next week, along with the National Defense Authorization Act, which the House passed earlier Thursday.
If House and Senate negotiators agree on funding bills for individual government agencies and pass an omnibus spending bill before Jan. 15, then another government shutdown will be avoided.
Before the vote, House Speaker John Boehner, R-Ohio, defended the deal for the second day, telling a news conference conservative activist groups had "lost all credibility" by attacking the deal before it was announced.
"I think they're pushing our members in places where they don't want to be, and frankly I just think that they've lost all credibility," he said.
"If you are for more deficit reduction, you are for this agreement," Boehner had said Wednesday amid complaints from conservative lawmakers and outside conservative groups the bill does too little to curb government spending.
The two-year compromise deal shrinks the deficit $85 billion in 10 years, the non-partisan Congressional Budget Office said.
Boehner and other GOP leaders said it also increases military and domestic spending in the current and next fiscal years by some $62 billion.
At the same time the deal reduces taxpayer contributions to federal-worker pensions, increase private companies' premiums for federal insurance of their pensions and raise fees on airline tickets to pay for airport security.