Stocks staged a broad rally on Friday as after better-than-expected economic data boosted optimism and sent investors out to snap up shares battered by last week's rout.

Although Wall Street is still deeply worried about the economy and the scope of U.S. military actions after the Sept. 11 attacks, the market recovered more than a third of the losses it posted last week, when the Dow Jones industrials fell 1,369.

The Dow Jones industrial average ended up 166.14 points, or 1.91 percent, to 8,847.56, extending a 114-point advance from Thursday. The Nasdaq composite index gained 38.09 points, or 2.61 percent, to 1,498.80, and the Standard & Poor's 500 index advanced 22.33 points, or 2.19 percent, to 1,040.94.

The blue-chip Dow average jumped 7.4 percent this week — its first rally after four weeks of declines and its biggest percentage gain since 1984, said research firm MarketHistory.com.

"Most investors believe this is as close to the bottom as they're going to see," said Erick Maronak, research strategist for NewBridge Partners, which oversees $3.5 billion. "A few more negatives came out of Sept. 11, but ... you can see there are economic and financial positives — we've had rate cuts and energy prices are down."

The waves of profit warnings and layoff announcements, already a fixture in the third quarter, accelerated into a flood of bad news after the Sept. 11 air attacks that destroyed the World Trade Center in New York City and damaged the Pentagon near Washington, D.C.

Airline stocks, such as US Airways Group , which rose 13.4 percent, helped boost the broader S&P 500 index.

Advancing issues outpaced decliners by four to one in heavy trading on the New York Stock Exchange, where 1.65 billion shares changed hands. More than two stocks rose for every one that fell on the Nasdaq, and about 2.1 billion shares traded.

Friday was the last day of the worst quarter since 1987 for both the blue-chip Dow average and the broader Standard & Poor's 500 Index, according to MarketHistory.com.

For the week, the S&P 500 jumped 7.8 percent, while the Nasdaq gained 5 percent. Last week, the Dow marked its biggest weekly drop since the Great Depression in the 1930s.

For the year, the Dow is off 18 percent, the S&P 500 has lost 21.2 percent and the Nasdaq Composite is off 39.3 percent, making it the worst January-to-September period ever for the tech-heavy market measure, MarketHistory said.

Stocks plunged to three-year lows last week — the first week of trading after the attacks on the United States — as Wall Street worried about the outlook for corporate profits, given the costs of possible military retaliation or a prolonged economic slump.

But indexes have clawed back as investors bet stock prices are cheap, considering the Federal Reserve's eight interest-rate cuts this year.

The average trailing price-to-earnings ratio for companies in the S&P 500 has dropped to 19.4 from 20.9 before the attack, research firm Thomson Financial/First Call said.

Investors will be anticipating the outcome of the Federal Reserve's policy-making committee meeting Tuesday, when the panel will discuss whether to slash rates again this year in another attempt to prop up the slumping economy.

"There is a sense we are not yet back to normal, but starting to" get there, said John Davidson, chief investment officer at Circle Trust Co., which manages $8 billion. "Next week, I am guessing there will be a 50-basis-point cut in the federal funds rate, which should help shore up confidence."

Corporate America continued to blame fallout from the Sept. 11 attacks for crimping earnings by exacerbating a slowdown that had already been under way. But on Friday, investors said they were looking past the immediate numbers.

Travel and residential real estate company Cendant cut its earnings outlook, saying recent acquisitions will add less of a boost to its earnings than earlier expected, due to the attacks.

Still, the stock rose $1.36 to $12.80 after Cendant said 2002 earnings would be higher than this year's and it will go ahead with its plan to buy travel-related companies Galileo and Cheap Tickets.

United Parcel Service, the world's No. 1 package-delivery company, said profit may be as much as 18 percent lower than expected because of a dramatic drop in shipping activity immediately after the attacks. But shares rose $2.26 to $51.98, as the report removed a measure of uncertainty of how badly package shippers had been hurt. Wall Street was also cheered by reports of a rebound in package shipping volumes.

Safeway Inc., the No. 3 U.S. grocery chain, rose $1.22 to $39.72 after reporting profit that met Wall Street's expectations and said it is comfortable with analysts' fourth-quarter forecasts.

Some economic numbers were better than expected, even as they underlined the slowdown in the economy.

Consumer confidence, as measured by the University of Michigan's sentiment index, fell to 81.8 — its lowest level in nearly eight years — but was much better than the drop to 79.6 that economists had forecast.

And fund managers took heart from The National Association of Purchasing Management-Chicago's barometer of manufacturing activity in the Chicago area, which rose to 46.6 in September. Although a number below 50 signals a contracting manufacturing economy, the gain came as a surprise to analysts, who had estimated the barometer fell to 40.7.

"Investors are willing to stay the course here," said Tim Woolston, who helps oversee $1.7 billion for Boston Advisors. "We had some economic news that showed improvement and I think the economy will recover over the next six months or so."

The U.S. gross domestic product grew by 0.3 percent in the second quarter — higher than the 0.1 percent gain expected by economists — according to the Commerce Department's third and final reading. But analysts noted that period preceded the attacks on New York and Washington.

The Russell 2000 index gained 11.91 to 404.87.

Overseas, Japan's Nikkei stock average gained 0.8 percent. European stocks also were higher. Germany's DAX index advanced nearly 3.0 percent, Britain's FT-SE 100 rose 2.9 percent, and France's CAC-40 climbed 1.6 percent.

Reuters and the Associated Press contributed to this report.