The House voted 257-167 in support of the legislation that earlier passed the Senate by an overwhelming 89-8.
"A central premise of my campaign for president was to change the tax code that was too skewed towards the wealthy at the expense of working, middle-class Americans," President Barack Obama said at a White House news conference after the vote. "Tonight, we've done that. Thanks to the votes of Democrats and Republicans in Congress, I will sign a law that raises taxes on the wealthiest 2 percent of Americans while preventing a middle-class tax hike that could have sent the economy back into recession and obviously had severe impact on families all across America."
Obama thanked Vice President Joe Biden and congressional leaders for their work in reaching the deal, which includes an extension of unemployment benefits. He said the law is just "one step in the broader effort to strengthen our economy and broaden opportunity for everybody."
Obama said the deficit is still too high, and the government needs to invest more in growing the economy.
He acknowledged there is "unnecessary spending in government" that can be eliminated, but "we can't simply cut our way to prosperity."
The president took a sharp stand on looming debt-ceiling negotiations, saying he won't stand for the "drama" and "brinksmanship" that characterized last year's battle over paying the government's bills.
"While I will negotiate over many things, I will not have another debate with this Congress over whether or not they should pay the bills that they've already racked up through the laws that they passed. Let me repeat: We can't not pay bills that we've already incurred. If Congress refuses to give the United States government the ability to pay these bills on time, the consequences for the entire global economy would be catastrophic -- far worse than the impact of a 'fiscal cliff.'"
The White House said Obama would reunite with his family in Hawaii for the remainder of their vacation.
Earlier Tuesday, Boehner and Biden wrangled support for a compromise in the face of mounting Republican opposition. Cantor forcefully expressed his opposition behind closed doors before the vote, and other Republicans did the same, The Washington Post reported.
The Congressional Budget Office estimated the measure will add nearly $4 trillion to the U.S. debt in the next 10 years because of lost revenue or payments on refundable tax credits, Politico reported.
Biden also met with House Democrats, the Los Angeles Times reported. Some liberal groups have been calling on them to reject the compromise on the grounds that the threshold for tax increases is too high.
"It is clear that the vice president and the president are convinced that they have done the right thing. They don't see it as a perfect deal though, and nobody else does," Rep. Elijah Cummings, D-Md., told The New York Times before the House vote.
The compromise extends current tax rates for the middle class and delays automatic spending cuts.
The deal hammered out by Biden and Senate Minority Leader Mitch McConnell permanently extends tax rates lowered during President George W. Bush's administration on individual income up to $400,000 and family income up to $450,000. The lower Bush-era tax rates for higher incomes would expire and return to the higher rates in effect during President Bill Clinton's administration.
It also permanently sets the estate tax rate at 40 percent, an increase from 35 percent, and would exempt inheritances of less than $5 million, The Hill said. It postpones the automatic spending cuts for two months and offset the delay's $24 billion cost with a combination of spending cuts and new revenues. The measure also extends unemployment benefits for one year without offsetting their impact on the deficit and prevents a hike in congressional pay.
On the Senate floor, McConnell, R-Ky., said every senator could spend time discussing the perfect solution, "but the end result would have been the largest tax increase in American history," Politico reported.
"The president wanted tax increases, but thanks to this imperfect agreement, 99 percent of my constituents won't be hit by those hikes," he said. "So it took an imperfect solution to prevent our constituents from very real financial pain. But in my view, it was worth the effort."
Democratic Sens. Michael Bennet of Colorado, Tom Carper of Delaware and Tom Harkin of Iowa voted against the bill, as did Republicans Chuck Grassley of Iowa, Mike Lee of Utah, Rand Paul of Kentucky, Marco Rubio of Florida and Richard Shelby of Alabama.
"This historic vote protects working families from an income tax increase and spares our economy from a devastating political disaster," Sen. Dick Durbin, D-Ill., assistant majority leader said. "We now turn to the House and ask them to act with dispatch to prove our government can truly respond in a bipartisan way in the best interests of the people we represent."
The bill also:
-- Extends by five years the college tuition tax credit, the child tax credit and the earned income tax credit.
-- Sets the capital gains and dividends tax rate at 20 percent, up from 15 percent.
-- Reinstates the Clinton-era limit on itemized deductions for individuals earning more than $250,000 and families earning more than $300,000.
-- Permanently patches the Alternative Minimum Tax and extend a number of expiring business and energy tax provisions for a year.
-- Freezes scheduled cuts to doctors' Medicare payments for one year, paying for them with spending cuts in other healthcare spending
-- Extends by a year the 2008 farm bill without dairy reforms.
"There is a feeling ... that it's not that this proposal is regarded as great or is loved, in any way, but it's a lot better than going over the cliff," Sen. Charles Schumer, D-N.Y., said.
Conservative and liberal advocacy groups and unions both blasted the bill, The Hill said.
"To be clear, this is a tax increase," Heritage Action for America, a conservative advocacy group, said in a statement while urging lawmakers to oppose the deal.
Liberal groups and unions complained the White House and Democrats were ceding too much, particularly given that Obama pledged during the campaign to raise tax rates on households with annual income of more than $250,000.