Republican leaders bowed to intense political pressure to extend a payroll tax holiday for 160 million Americans, ending a tense stalemate and handing a win to President Barack Obama.

The deal, which must be confirmed by votes in both chambers of Congress, allowed Obama to end the year on a triumphant note as he contemplates his reelection bid, after spending most of 2011 being thwarted by Republicans.

Republican leaders in the House of Representatives agreed to back a two-month extension of a two percent payroll tax cut, after originally blocking the measure, the product of a bipartisan compromise in the Senate.

Their tactics had sparked a torrent of derision from the media, some conservative luminaries and Democrats who eagerly seized a chance to pose as the party of lower taxes, a mantle that Republicans usually claim.

"(It) may not have been politically the smartest thing in the world," Republican House Speaker John Boehner said of the Republican gambit, partly powered by Tea Party conservatives, after after announcing the deal.

Obama had enlisted the help of supporters on Twitter and the Internet to argue that many Americans would have been badly hurt by losing $40 from their paycheck each two weeks if the tax holiday expired on January 1.

"I want to thank every American who raised your voice to remind folks in this town what this debate was all about," Obama said.

"It was about you. And today, your voices made all the difference."

Earlier, a tetchy Obama held a televised event to vent fury that though most people in Washington agreed on the need to extend the tax break, Congress could not agree on the length of the extension.

The Senate had agreed on a temporary two month measure while the House was pushing for a year-long plan.

"Has this place become so dysfunctional that even when people agree with things we can't do it? It doesn't make any sense. Enough is enough," Obama said.

If any lawmaker raises objection to the plan, congressional leaders will be forced to recall their chambers for a full vote next week. Boehner will try to pass the deal by voice vote in the House on Friday, and the Senate will seek to follow suit.

Obama has delayed plans to join his wife and daughters for their annual Christmas and New Year vacation in Hawaii over the standoff.

The new compromise will also see Democratic Senate leader Harry Reid appoint negotiators to work on a one-year extension to the payroll tax break, which was sought by the House.

It included facesaving language easing the burden of the tax cut on small businesses, which Republicans were able to argue was included only as a result of their holdout.

The deal means the payroll tax deduction, which is separate from income taxes and funds the US retirement system, will remain at 4.2 percent instead of rising to 6.2 percent on January 1.

It also means that two million Americans will keep unemployment benefits that were due to expire at the end of the year.

After days of wrangling Republican Senate Minority leader Mitch McConnell, one of the sharpest Washington operators, had weighed in on Thursday, sketching the eventual compromise in an intervention that may have been decisive.

Obama will savor a victory after a stalemate which has seemed to boost his standing, with his approval ratings approaching the crucial 50 percent mark, 11 months before he asks voters for a second term.

The outcome of the tussle may also quell some critics who have argued that the president has frequently come off second best in the gruelling daily trench warfare with Republicans in Congress.

But Obama did not have things all his own way.

Thursday's deal preserves language in the payroll tax bill requiring the president to take another look at a controversial US-Canada oil pipeline project which he had hoped to defer until after his re-election bid.

The plan to build an extension to the Keystone XL pipeline has split environmentalists, union workers and business groups in the Democratic base vote, and looms as a high stakes decision for Obama.

Republicans say the project will create thousands of jobs -- a claim Democrats dispute -- and will be sure to use to project for political capital if the administration seeks to block it.

"With today's agreement between the Speaker and Leader Reid, working Americans can breathe a sigh of relief knowing their taxes will not go up at the end of the year and that the President will have to finally decide on whether to move forward on a pipeline project that would create thousands of American jobs," McConnell said.