The measure still must gain approval in the Senate before it goes to the White House where President Barack Obama has promised to sign it into law. It passed the House 269-161.
Passage in the Senate was seen as nearly certain. The upper chamber was slated to vote on it at noon Tuesday, just hours before the midnight deadline for lifting the $14.3 trillion cap U.S. borrowing.
In the minutes before the legislation won approval, applause rang out through the lower chamber as Democratic Rep. Gabrielle Giffords made a dramatic appearance on the House floor, her first since she was shot during a meeting with constituents at a Tucson, Arizona, shopping center in January. Giffords has been undergoing rehabilitation since she was gravely wounded by a gunshot that pierced her brain. She acknowledged her warm welcome, standing among well-wishing colleagues, raising her left hand to waive to fellow legislators in the House.
Her office said she had returned Monday in support of the measure that was passed by the House.
While the odds were in favor of House passage, the compromise deal deeply angered both right-wing Republicans and left-wing Democrats.
The measure was crafted through the crucible of one of the United States' nastiest political fights in recent history. It carefully threaded the needle between the philosophically opposite ends of the political spectrum.
Polls showed that Congress and even Obama have taken a sharp hit in U.S. public opinion because of the prolonged battle over lifting the debt ceiling, something that past Congresses have done as a matter of course.
Without legislation in place by the end of Tuesday, the Treasury would run out of cash needed to pay all its bills which could interrupt payments to investors in Treasury bonds, recipients of Social Security pension checks, anyone relying on military veterans' benefits and businesses that do work for the government. Administration officials say a default would ensue that would severely damage the economy.
Beyond merely avoiding disaster, Obama and congressional leaders hoped their extraordinary accord would reassure investors at home and around the world, preserve the United States' Aaa credit rating and begin to slow the growth in America's soaring debt.
News of the agreement initially buoyed global investors, but European markets surrendered those increases and closed down significantly on worries about the American economy. U.S. stocks also climbed after opening but slipped well into negative territory after a bad report on American manufacturing. Shares closed the day, however, down only about 11 points, or .09 percent.
Before the vote, Obama sent a video to Congress aimed at selling Democrats on the plan. "This has been a long and messy process," he said. "As with any compromise, the outcome is far from satisfying."
As the Senate opened for business Monday, Majority leader Harry Reid declared the deal shows that the often-dysfunctional Senate can come together when it counts. "People on the right are upset, people on the left are upset, people in the middle are upset," he said. "It was a compromise."
The deal came together Sunday night when Obama sealed a deal with leaders of both parties in both houses of Congress on the plan that would initially cut about $1 trillion from U.S. spending.
Obama and many economists and financial experts predicted global chaos and plunging stock markets without the legislation.
House Speaker John Boehner, obviously pleased and relieved at the House vote, gaveled the measure as passed. His standing took a beating in the long fight as he struggled to meld the wishes of the low-tax, small-government tea party wing of his party — 87 new members elected last year — and more mainstream Republicans in the House.
The tea party and Republicans more largely successfully blocked Obama's attempts to raise taxes as part of the plan to slash the deficit, but the president was successful in blocking opposition attempts at a short-term debt ceiling extension. That would have returned the now-poisonous issue to the national agenda early next year, in the midst of the presidential and congressional election campaign.
At a news conference Monday afternoon Boehner said the compromise would "solve this debt crisis and help get the American people back to work."
House Democratic leader, Rep. Nancy Pelosi, was far less effusive. "I'm not happy with it, but I'm proud of some of the accomplishments in it. That's why I'm voting for it."
The broadest outlines of the emerging plan, a deal that involved deep negotiations between Senate Republican Leader Mitch McConnell and Biden, would raise the federal debt limit in two stages by at least $2.2 trillion, enough to tide the Treasury over until after the 2012 elections.
The cuts in government spending would be phased in over a decade. Thousands of programs could be trimmed to levels last seen years ago.
No benefit cuts were envisioned for the Social Security pension system or Medicare, the federal programs that provide health care payments to the elderly. But other programs would be scoured for savings. The possibility of higher taxes taking effect were hotly disputed and off the table in the near future.
Video: Obama adviser: Debt deal will pass
The first step would take place immediately, raising the debt limit by nearly $1 trillion and cutting spending by a slightly larger amount over a decade.
That would be followed by creation of a new congressional committee that would have until the end of November to recommend $1.8 trillion or more in deficit cuts, targeting benefit programs, such as Medicare and Social Security, or overhauling the tax code. Those deficit cuts would allow a second increase in the debt limit, which would be needed by early next year.
If the committee failed to reach its $1.8 trillion target, automatic spending cuts totaling $1.2 trillion would kick in, and the debt limit would rise by an identical amount. The conservative campaign to force Congress to approve a balanced-budget amendment to the Constitution has been jettisoned.
Social Security, as well as the Medicaid and food voucher programs that provide health care and grocery money for the poor, would be exempt from the automatic cuts, but payments to doctors, nursing homes and other Medicare providers could be trimmed, as could subsidies to insurance companies that offer an alternative to government-run Medicare.