The House of Representatives gave final approval on Friday to the $700 billion bailout for the financial system, reversing course to authorize what may be the most expensive government intervention in history.

At 1:21 p.m., applause and cheers echoed through the House chamber as the number of "aye" votes crossed the threshold needed for passage with just seconds remaining in the official 15-minute voting period. The vote was 263 to 171.

And in a sign of the urgency surrounding the package, Congressional staff rushed the newly printed legislation into a news conference where Democratic leaders gathered after the vote and Speaker Nancy Pelosi, Democrat of California, signed it, at exactly 2 p.m.

Within an hour, the legislation had been conveyed to the White House and signed by President Bush. Standing in the Rose Garden shortly before signing the document, the president thanked Congressional leaders of both parties by name and said they had achieved something "essential to helping America's economy weather the financial crisis."

Earlier, Ms. Pelosi said the measure was essential to "begin to shape the financial stability of our country and the economic security of our people."

Representative John A. Boehner of Ohio, the Republican minority leader, had urged passage by warning that "if we do nothing, this crisis is likely to worsen and to put us into an economic slump like most of us have never seen."

Most Democrats favored the bill (172 yeas to 63 nays), while a slighter majority of Republicans voted against (91 yeas to 108 nays). Every member of the House voted. (There is one vacancy, created by the recent death of Stephanie Tubbs Jones, a Democrat of Ohio.)

A significant number of Republicans changed their votes from last Monday, when only 65 voted in favor. President Bush spoke to "about three dozen" House members this week to try to persuade them to switch from "no" to "yes," the White House spokesman Tony Fratto said.

Another kind of persuasion surrounded the Senate deliberations of the bill. A portfolio of popular tax provisions was added before the Senate voted in favor of the program on Wednesday night by 74 to 25.

Treasury Secretary Henry M. Paulson Jr. said agency workers were already working on details to put the rescue plan into effect, so that no time will be lost now that the president had signed the legislation. Mr. Paulson called the House action "a vote to protect the American people - and their jobs."

Mr. Paulson, who appeared with President Bush in the Rose Garden, was asked how he felt now that the rescue plan has cleared Congress.

"Better," Mr. Paulson replied.

Financial markets, already weighed down by another round of bleak economic data, including a report showing 159,000 jobs were lost in September, had a mixed response to the House action. Ahead of the vote, the Dow was up about 290 points, but it later sagged, hovering around 100 by 2 p.m., then dipped briefly into negative territory before climing back.

After the remarkable defeat of the bailout package on Monday, Congressional leaders took no chances on Friday. Democrats had said they would not bring the bill back to the floor unless they were certain of victory.

The revolt earlier this week by the House's rank and file was quelled both by fears of a global economic meltdown, and by old-fashioned political inducements added to the deal by the Senate.

And just to be sure, the leaders had a backup plan, giving them the option to interrupt the proceedings and debate an increase in unemployment benefits, so that they could round up additional votes. In the end, it was not needed.

Many lawmakers who changed sides, said they had agonized over the decision amid a torrent of calls and e-mail messages from constituents, and several cited a provision added by the Senate increasing the amount of savings insured by the federal government to $250,000 an account from $100,000.

Several Democrats in the Congressional Black Caucus said they were persuaded to support the bill by Senator Barack Obama, the party's presidential nominee. But many lawmakers said they were motivated most by fears of economic calamity.

"Nobody in East Tennessee hates the fact more than me that I am going to vote 'yes' today after voting 'no' on Monday," Representative Zach Wamp, a Republican, said in a speech on the House floor.

"Monday I cast a blue-collar vote for the American people," he said. "Today I am going to cast a red, white and blue-collar vote with my hand over my heart for this country, because things are really bad and we don't have any choice. We're out of choices and our backs are up against the wall."

Friday's action capped an extraordinary two-week dénouement to the 110th Congress. Lawmakers, eager to get home for the fall campaign season, had intended to wrap up by adopting a budget bill to finance government operations through early March.

Supporters said the bailout was needed to prevent economic collapse; opponents said it was hasty, ill-conceived and risked too much taxpayer money to help Wall Street tycoons, while providing no guarantees of success. In the Senate, lawmakers who opposed the plan on Wednesday warned that it still did not address the root problems in the American financial system, including lax regulation.

The rescue plan allows the Treasury to buy troubled debt from financial firms in an effort to ease a deepening credit crisis that is choking off business and consumer loans, the lifeblood of the global economy, and contributing to a string of bank failures in the United States and Europe. The hope is that clearing the balance sheets of bad debt will keep credit flowing and prevent normal economic activity from stalling.

Whether it succeeds or fails, elected officials and business leaders alike said it stands to fundamentally alter the relationship between government and the private markets perhaps in ways that are not immediately clear.

But it was a hollow victory for the administration. After long favoring a hands-off approach and relentlessly pursuing deregulation, the administration found itself interceding repeatedly in the private market this year to avert one calamity after another. And finally after it proposed perhaps the biggest intervention in history, Mr. Bush found himself abandoned by fellow Republicans in the House.

After the House rejected the plan, the Senate stepped in, and attached a $150.5 billion package of popular provisions, including tax breaks for the production and use of renewable energy and protection for millions of American families from paying the alternative minimum tax, which was initially aimed at the wealthy.

The Senate and the House had been fighting all year over the energy tax provisions, called "extenders" because they perpetuate current law. The energy package provided a ready bundle of goodies that the Senate had been dangling to win over fiscal conservatives who had opposed the Senate version because it did not fully offset the tax breaks with spending cuts or other tax increases.

The approval of the bailout plan came 13 days after the administration put forward a three-page proposal that would have given the Treasury secretary unfettered authority to run the $700 billion effort, in what Ms. Pelosi called "czar-like powers."

Tense negotiations over eight days - including an extraordinary and contentious meeting at the White House between Mr. Bush, top lawmakers and the two presidential candidates, Senator John McCain and Mr. Obama - produced a compromise that all sides said they could support if unenthusiastically.

The final agreement called for the $700 billion to be disbursed in parts: $250 billion at first, to get the program started, followed by $100 billion at the discretion of Mr. Bush and the remaining $350 billion upon request of the Treasury with Congress empowered to block the last installment by acting within 15 days.

It is impossible to predict the final cost of the bailout but officials insist it will be far less than $700 billion. Because the Treasury will purchase and then resell assets, potentially at a higher price, there is a chance the program will break even or perhaps turn a profit.

The deal provides for tight oversight by two boards, including an independent Congressional panel. And requires the government to use its status as an large-scale owner of distressed, mortgage-backed securities to take more aggressive steps to prevent foreclosures.

The bill also seeks to limit the pay of executives of some companies that sell bad debt to the government, including restrictions on so-called "golden parachute" retirement plans.

It also provides several taxpayer protections, including a mechanism for the government to take an equity stake, in the form of stock warrants, in some of the firms that seek government help, which will give taxpayers a chance to make money should the companies profit in the months and years ahead.

And, if the rescue plan has lost money after five years, the bill requires the president to submit a plan to Congress for recouping the losses from the financial industry, perhaps through fees or a tax on securities transactions.