WASHINGTON — A plan to lift the nation’s debt limit and reduce government spending cleared a crucial hurdle in the House on Monday night, as recalcitrant Republicans and disappointed Democrats rallied around a measure to avert a government default.

With Senate approval all but certain, the 269-161 vote in the House ended a months-long partisan stalemate that threatened to destabilize global markets and undermine the sputtering economic recovery.

The Senate vote is set for noon today. Approval would send the measure to President Obama and immediately grant the Treasury $400 billion in additional borrowing authority, just hours before a midnight deadline.

House Speaker John Boehner, R-Ohio, won over more than two-thirds of his caucus by assuring the lawmakers that few GOP priorities were in the line of fire and that Obama had retreated on his demand for higher taxes.

Angry Democrats largely shared that assessment. But after withholding their votes for most of the roll call, they split evenly for and against the proposal, which would cut at least $2.1 trillion from projected borrowing over the next decade without any immediate provision for new taxes.

A grueling battle that had consumed Congress for most of the spring and summer ended with a large round of bipartisan applause shortly after 7 p.m., when the legislation secured a majority.

The lawmakers were brought to their feet again by the stunning appearance of Rep. Gabrielle Giffords, D-Ariz., who cast her first vote since she was shot in the head in early January in Tucson.

The shooting prompted several weeks of soul-searching on Capitol Hill about the hostile partisan rhetoric that often fills congressional debates and campaigns, a brief respite that soon passed as Congress headed into six straight months of warfare over federal budgets.

The debt plan prompted grumbling from some GOP defense hawks about proposed cuts to next year’s Pentagon budget. But Monday’s final hours were more notable for the cries from House liberals, who charged that the measure gave them little to support. Aside from potential military cuts, Democrats said the agreement calls on Republicans to sacrifice very few priorities, while asking Democrats to accept steep reductions in programs that benefit the middle class.

“It’s time for America to deal with its spending problem, and deal with the fact that we’ve made promises to the American people that our kids and grandkids just can’t afford,” Boehner said at a news conference 3½ hours before he gaveled the vote closed.

Just four days after Boehner suffered a humiliating defeat when he could not pass similar legislation solely on GOP votes, the speaker still saw 66 defections from his side of the aisle.

The agreement was sealed late Sunday after weeks of acrimonious debate. If approved by the Senate, it will raise the $14.3 trillion debt limit by at least $2.1 trillion, including the immediate $400 billion released upon Obama’s signature.

An additional $500 billion would come in the fall, unless two-thirds of both chambers of Congress voted to prevent it. The final increase, which would occur early next year, would provide the Treasury with sufficient borrowing power to pay the bills into early 2013.

The deal also calls for sharp cuts in agency spending – about $917 billion over the next decade, according to congressional budget analysts, starting with a $25 billion reduction in the fiscal year that will begin in October.

The agreement on agency spending next year makes it far less likely that a funding dispute will shut down the government before the 2012 presidential election.

A second stage of reductions would come later this year, with the appointment of a special committee charged with wringing at least $1.2 trillion more out of the budget over the next decade.

If the committee failed to act – or if Congress did not adopt its recommendations – government spending would be cut across the board by the same amount, with the reductions split 50-50 between domestic programs and defense.

House Democratic Minority Leader Nancy Pelosi, D-Calif., emphasized that the “trigger” would exempt programs for the poor, including Medicaid, Social Security, food stamps, and health and nutrition programs for children.

Despite those small Democratic victories, House liberals were furious about the agreement. In an interview with ABC News, Pelosi echoed the comments of Rep. Emanuel Cleaver, D-Mo., a leading member of the Congressional Black Caucus, who called the deal a “Satan sandwich.” Pelosi added, “With some Satan fries on the side.”

A day after finalizing the deal with Senate Minority Leader Mitch McConnell, R-Ky., Vice President Joe Biden traveled to Capitol Hill to quell the liberal ire.

First he sought to calm Senate Democrats, then he trudged into the basement of the Capitol Visitor Center to face a barrage of complaints from House Democrats that went on for more than two hours.

Biden told reporters that he sympathizes with Democrats.

“I would be frustrated if I were sitting there as well. That it’s been taken down to the wire like this,” he said.

But Biden argued that in supporting the measure, they would help Obama pivot away from the budget battles and debt-limit debacle that have dominated Washington for the past seven months and renew his focus on the economy and job creation.

“If it passes and is signed into law, we will be talking about nothing come then but about jobs,” he said, likening the threat of default to a “sword of Damocles” that has been dangling over the president’s head.

“We have to get this out of the way to get to the issue of growing the economy,” Biden said.