The U.S. House of Representatives gave the green light to a Senate-approved deal to avert the fiscal cliff of major tax increases and spending cuts late Tuesday.

The House voted 257-167 to pass the emergency legislation without amendments some Republicans had demanded earlier.   

The bill now just needs a signature from President Barack Obama, who congratulated both Democrats and Republicans on working to push through such a contentious piece of legislation.

Had the deal not passed, “we could have sent the economy back into a recession and obviously had a severe impact all across America,” Obama said late Tuesday after the vote.

The fiscal cliff bill had passed 89-8 in the Senate less than 24 hours earlier, after that vote continued through New Year’s Eve.

Lawmakers wanted to resolve any uncertainty before financial markets reopen on Wednesday and a new Congress takes office on Thursday.

U.S. Vice-President Joe Biden also met with House Democrats to sell them on the deal he brokered with Senate Republican leader Mitch McConnell on Monday.

After much haggling, the Senate OK’d a compromise deal  that would maintain tax cuts for individual Americans earning less than $400,000 and couples making less than $450,000. The legislation also blocks spending cuts for two months and extends unemployment benefits for the long-term jobless.

That increase was a hard-earned victory for Obama, who campaigned on a platform of higher tax rates for the wealthy, but is still far above the $250,000 income level he proposed for higher taxation.

Conceding both sides didn’t get everything they wanted, Obama referred to the deal as the “right thing to do” for the United States.

But he said Tuesday that the lawmakers’ hard work is far from over.

“I think we all recognize that this law is just one step in the broader effort to strengthen our economy and broaden opportunity for everybody,” he said, noting that the U.S. deficit is still too high and that not enough investments are being made to boost the economy.  

The two sides found $24 billion in spending cuts and new revenue. But the deal defers $109 billion in cuts to defence and domestic program spending until March. It also blocks a $900 pay raise for politicians that was due to take effect in the spring.

Economists have warned that the combination of tax hikes and spending cuts that were due to take effect at midnight Monday could cause a spike in unemployment and push the U.S. economy into a new recession.

Congress and The White House have struggled since the U.S. elections in November to reach a compromise that would protect the fragile economy. The White House had been seeking an agreement to stop the cuts from taking effect and want to offset the cost with higher taxes created elsewhere, officials said.

Republicans were willing to delay spending cuts for a couple of months, as long as the Democrats agreed to targeted savings from government programs.

Other highlights from The Associated Press files:

- Estate tax: Estates would be taxed at a top rate of 40 percent, with the first $5 million in value exempted for individual estates and $10 million for family estates. In 2012, such estates were subject to a top rate of 35 percent.

- Capital gains, dividends: Taxes on capital gains and dividend income exceeding $400,000 for individuals and $450,000 for families would increase from 15 percent to 20 percent.

- Alternative minimum tax: Permanently addresses the alternative minimum tax and indexes it for inflation to prevent nearly 30 million middle- and upper-middle income taxpayers from being hit with higher tax bills averaging almost $3,000.

- Other tax changes: Extends for five years Obama-sought expansions of the child tax credit, earned income tax credit, and an up to $2,500 tax credit for college tuition. Also extends for one year accelerated "bonus" depreciation of business investments in new property and equipment, a tax credit for research and development costs and a tax credit for renewable energy such as wind-generated electricity.

- Unemployment benefits: Extends jobless benefits for the long-term unemployed for one year.

- Cuts in Medicare reimbursements to doctors: Blocks a 27 percent cut in Medicare payments to doctors for one year.

- Social Security payroll tax cut: Allows a 2 percentage point cut in the payroll tax first enacted two years ago to lapse, which restores the payroll tax to 6.2 percent.

- Across-the-board cuts: Delays for two months $109 billion worth of across-the-board spending cuts set to start striking the Pentagon and domestic agencies this week. Cost of $24 billion is divided between spending cuts and new revenues.