The Republican measure was passed by 219 votes to 206 after President Barack Obama had urged Democrats to support the budget.
It will fund most of the government until September 2015, but some areas will only receive short-term funding.
Republicans won control of both House and Senate in elections last month.
A relieved John Boehner, the Republicans’ House leader, said: “Thank you and Merry Christmas.”
Fifty-seven Democrats voted for the bill, but others were angry about the president’s call for support of the Republican bill, with Democratic House leader Nancy Pelosi saying she was “enormously disappointed” at Mr Obama’s position.
The Republicans strongly oppose President Obama’s immigration reforms and so the bill only funds the Department of Homeland Security until February.
Republicans hope that when the new Congress meets at the start of next year, they can force changes to the president’s immigration plans.
The budget bill must now be passed by the Senate and sent to the president to sign into law.
A two-day extension of government funding was approved by the Senate on Thursday to give it time to pass the main budget.
Senate Majority leader Harry Reid said that his chamber would begin looking at the legislation on Friday.
The bill funds the government at the same levels that were negotiated last December.
It also adds emergency funding requested by President Barack Obama, including funds to fight Ebola in West Africa and money for US air strikes against militant group Islamic State in Iraq and Syria.
As presented earlier in the week, the 1,600-page bill also includes a number of provisions intended to gain votes from both parties, including:
Increasing the amount an individual person can contribute to a national political party from $32,400 to $324,000 blocking the District of Columbia from using its own funds to set up regulatory systems for marijuana legalisation measures that would significantly weaken financial regulations in the Dodd-Frank law, including restrictions on derivatives trading blocking certain Environmental Protection Agency (EPA) regulations cuts in the budgets of the EPA and the US tax agency increases in the budget for Wall Street regulation agencies, including the Securities and Exchange Commission.
A number of Democrats were unhappy at what they saw as unnecessary concessions made to Republicans in order to pass the bill.
“We don’t like lobbying that is being done by the president or anybody else that allows us to… give a big gift to Wall Street,” Democrat congresswoman Maxine Waters said.
For their part, several Republicans argued that the deal did not go far enough in putting curbs on President Obama’s plan to grant work visas to millions of workers who had entered the US illegally.
The US government entered a partial shutdown during October 2013, after the two houses of Congress failed to agree a new budget.
That shutdown left more than 700,000 employees on unpaid leave and closed national parks, tourist sites and government websites.