US congressional leaders struck a $1 trillion funding deal to avert a pre-Christmas government shutdown, as talks between Democrats and Republicans for once defused a bitter confrontation. Negotiators were also considering an extension of a payroll tax cut demanded by President Barack Obama to put an extra $1,500 in the pockets of working Americans next year and stimulate the sluggish economy. Leaders from the Republican-controlled House of Representatives and the Democratic-run Senate agreed to allow a vote by Friday on a bill that would fund the US government through fiscal year 2012, congressional sources said. If the bill does not pass Friday, the vast machinery of the US government would grind to a halt, as federally-funded Christmas events, public buildings and government agencies ran out of money. \"I am hopeful that the House and Senate can pass this bill tomorrow to prevent a government shutdown, fund critical programs and services for the American people and cut spending to help put the nation’s finances on a more sustainable path,\" House Appropriations Committee Chairman Hal Rogers said. Talks took place throughout the day as lawmakers sought to break the impasse driven by pre-positioning for Obama\'s 2012 reelection bid and deep antipathy between the parties. The root of the stalemate lay in brinkmanship by both parties over a push by Obama for a tax cut for 160 million workers and a Republican bid to force him to reconsider delaying a decision on a Canada-US pipeline plan. Republicans had accused Obama of ordering Democrats to stall the funding bill until the payroll tax issue was agreed. Senate Democratic Majority Leader Harry Reid said he was weighing a two-month extension of the payroll tax cut and unemployment benefits that would leave current rates unchanged. Obama had called for a one-year extension. \"I always have a plan B,\" Reid said, though adding he hoped to still deliver a year-long extension of the payroll tax and unemployment insurance. A senior White House official signaled that Obama was open to a stop-gap solution if necessary. \"Our priority is ensuring that Congress not leave before they ensure that taxes don\'t go up on 160 million middle class families on January 1,\" the official said. \"A year-long extension is preferable, but the priority is ensuring taxes don\'t go up January 1.\" It was clear, however, that the White House will not get its wish for the payroll tax cut extension to be paid for by a surcharge on millionaires. House Speaker John Boehner mocked the idea that Democrats had made a concession, arguing Obama always lacked the votes to pass such a measure. But White House spokesman Jay Carney seemed to suggest Obama believed he had made his political point. Republicans \"were willing to say no to a tax cut for 160 million hardworking Americans rather than ask millionaires and billionaires to pay a little bit more. That\'s their position, and that\'s the reality,\" Carney said. Democrats are also complaining that Republicans acted in bad faith by attaching a measure to the payroll tax bill requiring Obama to reconsider delaying the Keystone XL pipeline from Canada\'s tar sands through the US heartland. Obama has put off a decision on the pipeline until after the election as it has whipped up a political storm and played off environmentalists and union leaders in his own voting base. But Republicans say the project could produce 20,000 jobs at a time of deep economic pain and are accusing Obama of political pandering. It remained unclear whether the Keystone pipeline provision would be taken out of a final bill on the payroll tax cut. Payroll taxes are separate from income taxes and extracted from workers\' pay packets to fund the social security retirement system. Obama says extending the tax cut gets money into the pockets of poorer workers most likely to spend it. The latest grandstanding came as a new poll showed that public discontent with Congress was at a record high, with two-in-three voters saying most lawmakers should be kicked out of office in 2012. Forty percent of respondents to the Pew Research Center poll blamed Republicans for the impasse in Congress, compared to 23 percent who fingered Democrats.