Lauren Victoria Burke, Associated Press
Securities and Exchange Commission Chairman Chris Cox talks to the media after meeting with congressional and financial leaders.

NEW YORK — One of the most tumultuous weeks in the 216-year history of Wall Street closed with a dramatic two-day rally as investors celebrated an unprecedented government plan to cleanse banks of the bad mortgages that touched off a crisis in world finance.

The details of the rescue — not to mention how many hundreds of billions of dollars it will cost — remained a mystery, but investors snapped up stocks anyway in hopes the end of the credit crisis was near.

The Dow Jones industrials shot up about 370 points, giving them a two-day gain of about 780. The week also included a drop of more than 500 points on Monday and nearly 450 points on Wednesday.

You would never have known it from the anxiety that gripped Wall Street and Washington, not to mention dinner tables across the nation, but stocks ended the week virtually unchanged, with the Dow Jones industrial average down 33.55 points for the week, or 0.3 percent. The Dow stood at 11,388.44 after Friday's trading, up more than 3 percent for the day.

As the closing bell sounded at the New York Stock Exchange, traders could finally pause and reflect on a week of operatic reversals of fortune and federal intervention that remade Wall Street itself.

Among the highlights: The Treasury extended an $85 billion loan to insurer American International Group. The government prepared to take over untold billions in toxic mortgage assets and placed a $50 billion safety net under money market funds. Regulators banned some short-selling. Of the five major U.S. investment houses in existence at the start of the year, two remained intact and independent.

"This was like trying to put a wildfire out," said David Resler, chief economist at Nomura Securities.

On Friday, bond prices tumbled after investors rushed back into stocks from the relative safety of Treasury securities. The increase in the yields of bellwether two-year bonds meant investors think the economy is fundamentally stronger than it seemed Monday and they don't see a rate cut soon.

Still, some were skeptical of the government intervention.

"This is the biggest travesty the federal government has ever gotten involved with," said Jay Brew, chief bank strategist at M. Rae Resources Inc. "This is just going to lead to a much deeper and prolonged recession."

It wasn't clear how much the latest rescue would cost. Speaking to reporters, Treasury Secretary Henry Paulson said the proposed relief program for troubled mortgage assets must be large enough to have an impact while protecting taxpayers as much as possible.

"I am convinced that this bold approach will cost American families far less than the alternative — a continuing series of financial institution failures and frozen credit markets unable to fund economic expansion," Paulson said.

Some people scratched their heads and questioned why Wall Street was being bailed out for risky bets it had earlier made profits on.

John Santisteban of Atlanta, a 58-year-old salesman for a security system company, said the government should ask for something in return from financial executives. "All their bonuses should have to be given back as part of the bailout package," he said.

President Bush, speaking from the White House Rose Garden, said: "America's economy is facing unprecedented challenges. We're responding with unprecedented measures." Leaders from the Fed and Treasury planned to meet with congressional leaders over the weekend.

It was an extraordinary week in Washington and New York. Lehman Brothers declared bankruptcy and spooked Merrill Lynch, which fled into the arms of Bank of America Corp. in a planned all-stock deal valued at roughly $55 billion based on Friday's stock prices.

Financial stocks were pummeled early in the week, but the sector turned around after Securities and Exchange Commission Chairman Christopher Cox announced a ban on some short-selling, one method of betting a stock will fall. The financial stocks in the Standard & Poor's 500 ended Friday's trading up 10 percent and managed a gain for the week.

The broader stock market clawed back earlier losses as it capped the week with a two-day rally, the largest since 2000. Gold prices, which had soared earlier in the week as investors sought a safe place to park their money, tumbled Friday, as did bonds. Money market funds, whose fragility earlier in the week was one catalyst for government intervention, appeared to stabilize.

The tumult began with a meeting last Friday night of Wall Street CEOs at the New York Federal Reserve. When they were unable to come up with a plan to rescue Lehman, traders were called in for an emergency session Sunday. Some were back at work at 3 a.m. Monday to follow the action in London. With news of Lehman's filing and Merrill's hasty deal to be bought by Bank of America Corp., stocks plunged. Investors saw their biggest one-day losses since the 2001 terrorist attacks.

Worse would come as panic infected money market funds. Credit markets froze after the Reserve Primary Fund, the nation's oldest money-market fund, said it was no longer able to assure clients it had the assets to back every dollar they had invested. It was the first time since 1994 that a money-market fund had seen its assets fall below its investments.

The announcement sparked panic. Investors rushed to withdraw their money from money market funds, and lending tightened worldwide. The interest for some overnight loans tripled, as banks hoarded cash. Lehman Brothers Holdings Inc., which filed for bankruptcy protection Monday, had sold off its North American operations to British purchaser Barclays PLC by Tuesday.

As losses piled up, Resler said Wednesday: "There's good reason to believe, very good reason, maybe as good as you'll ever see, that later we'll look back on today and say if you had bought at these prices, you paid a good price. Maybe not tomorrow or next month, but with the fullness of time, you'll look back at the prices you paid today and say you got a good purchase."

For two days, at least, he was right.