WASHINGTON - The House late Thursday followed the Senate in approving the sweeping tax-cut deal struck by President Obama and Republicans, a bipartisan package few could have imagined would emerge in polarized Washington.

The vote was 277-148 on the legislation, which also cuts Social Security taxes for nearly every wage earner in 2011, and renews a program of jobless benefits for the long-term unemployed. All area representatives voted in favor.

House members struggled to overcome a persistent protest from liberal lawmakers incensed that the compromise showers benefits even on the wealthiest.

Democratic leaders worked to allow liberal opponents of the deal a way to register their objections in a separate vote, but arranged to avoid any change that would send the bill back to the Senate with so little time remaining in the lame-duck Congress.

By nightfall, despite flaring tempers, a large enough coalition of House Democrats and Republicans appeared ready to approve the $858 billion in extensions of Bush-era tax cuts for all, as well as unemployment compensation and an array of tax credits.

Obama, while opposed to the breaks for the wealthy, is expected to swiftly sign the package into law, narrowly avoiding the tax increase that otherwise would hit nearly every taxpayer Jan. 1.

The deal contains a two-year extension of income-tax cuts approved during the George W. Bush administration, including for family earnings above $250,000, along with direct aid to the jobless and stimulus measures Republicans largely oppose.

Dividends and capital gains also would continue to receive Bush-era tax breaks, while middle-income Americans would see a one-year, 2-percentage-point payroll-tax cut that would place up to $2,000 in workers' pockets.

The deal - embraced fully by neither Democrats nor Republicans - came at the end of a congressional session that historians consider the most productive in 40 years.

Democrats were in the uncomfortable position of approving Bush tax breaks they had long opposed. Democrats say the breaks for the wealthy will drive up the national debt for the benefit of the few and won't help jump-start the economy.

Liberal House Democrats were particularly opposed to a $68 billion provision that would reinstate the estate tax at a 35 percent rate on estates above $5 million for singles and $10 million for families.

Democrats pushed until late Thursday for a 45 percent rate, with exemptions on estates below $3.5 million for singles and $7 million for families - as was in place until the tax lapsed at the end of 2009. The effort failed.

"I beg this body to defeat this bill," Rep. Gene Taylor (D., Miss.) said during debate, drawing applause.

Republicans, meanwhile, wrestled with the political reality that the package contains precisely the types of stimulus measures they opposed during the midterm election campaign.

Despite grassroots opposition to government spending, Republicans in the tax deal have agreed to renewable-energy grants and $56 billion in extended unemployment benefits through 2011 for as many as seven million jobless.

"I don't like this bill," said Rep. David Dreier (R., Calif.). "I don't know of anyone who stood up and said they like this bill."

Moreover, the cost of the package is neither covered nor offset anywhere in the federal budget, adding to the national debt at a time when a bipartisan fiscal commission has just released a stark report on the need to rein in deficit spending.

As the House debated the tax plan, some Democrats also warned that the payroll-tax cut could undermine the stability of Social Security.

Rep. Jerrold Nadler (D., N.Y.) said he feared the one-year cut in the Social Security payroll tax, to 4.2 percent from 6.2 percent on income up to $106,800, would weaken Social Security because Republicans would in the future insist on the cut being made permanent, and Democrats would relent.

"We know that, politically, once you make that tax cut it will be impossible to restore it," Nadler said.

Nonetheless, the bill swiftly passed the Senate on Wednesday on an 81-19 vote. That overwhelming support appeared to soften opposition among House Democrats.

Some, including Obama, have hailed the tax agreement as a prototype for hard-bargained compromises in the era of divided government.

But the accord also showed Washington policymakers locked in an unsustainable cycle of cutting taxes and raising spending that has proved politically palatable in the short term but could seriously threaten the nation's fiscal stability in years ahead.

The temporary nature of the deal, however, could lend momentum to broader efforts to overhaul the tax code and tackle the long-term deficit.

With the tax debate now scheduled to resume at the height of the 2012 presidential election campaign, some lawmakers say they hope the fiscal landscape can be redrawn and the cycle of lower taxes and higher spending halted.

Or, as Herbert Stein, the chairman of the Council of Economic Advisers under Presidents Richard M. Nixon and Gerald R. Ford put it: "If something cannot go on forever, it will stop."

This article includes information from the Associated Press and the New York Times.