Stocks rallied Wednesday as the first week of the earnings reporting season brought better-than-expected news and fears about the length and outcome of the U.S. retaliatory strikes in Afghanistan eased somewhat.

Major market gauges in the last couple of weeks have crept back from wrenching declines after the Sept. 11 attacks, and the broad market now is within a hair of levels reached before that date.

The blue-chip Dow Jones industrial average gained 188.42 points, or 2.08 percent, to 9,240.86, while the Nasdaq Composite index closed up 56.07 points, or 3.57 percent, at 1,626.26. The broader Standard & Poor's 500 index gained 24.24 points, or 2.29 percent, to 1,080.99, about 1 percent below its Sept. 10 closing level.

"There are still a lot of things that can go wrong, but I think right now the rally is based on the anticipation that things are going to get better and the military campaign will go OK," said James Volk, co-director of institutional trading at D.A. Davidson & Co.

Companies like PepsiCo, drugmaker Abbott Laboratories Inc. and semiconductor equipment maker Lam Research Corp. boosted the outlook for Corporate America after reporting quarterly profits that met or beat analysts' forecasts, despite the lagging economy.

"Investors are starting to believe the economy and earnings will begin to recover in the first quarter of 2002," said Hugh Johnson, chief investment officer at First Albany Corp.

Johnson added the market's ability to gain despite the outbreak of military action was attracting some of the substantial amounts of cash tucked away on the sidelines.

Semiconductor stocks bolstered the Nasdaq market as they bounced back from Tuesday's sharp fall. Top chip maker Intel Corp. rose $1.45 to $22.90, and the Philadelphia Stock Exchange's semiconductor index rose 4.53 percent.

Biotechnology stocks also got a boost amid increasing wariness about the potential for biochemical attacks.

Several firms that could be enlisted to detect biological attacks and treat its victims have already received contracts to produce vaccines and diagnostic devices, such as Nanogen Inc. and AVANT Immunotherapeutics Inc. , which announced government-related pacts on Wednesday.

Nanogen jumped $2.25 to $7.84, while AVANT gained $1.37 to $4.32.

This week marks the beginning of the third-quarter earnings season, when companies report financial results and hint at what is to come later in the year.

Wireless technology giant Motorola Inc. slipped 6 cents to $16.66. The company said it expects higher handset sales in the fourth quarter, but said it would likely report a loss and it would cut 7,000 more jobs this year.

Overall, the firm reported its third consecutive quarterly loss as demand for products declined, in line with forecasts.

Motorola rival Nokia Corp. jumped $1.66 to $18.66.

Lam Research, which makes equipment to manufacture semiconductors, rose 65 cents to $17.29 after reporting results that beat forecasts, citing "growing customer acceptance of our new products."

PepsiCo rose 70 cents to $49.63 after reporting a 14 percent rise in profits and forecast strong earnings growth in coming years as it remains resilient despite the economic downturn. It also said it is "committed" to earnings-per-share gains of 13 percent to 14 percent in 2002 and beyond.

Abbott Labs, a maker of pharmaceuticals, nutritional supplements and hospital products, rose $1.07 to $52.10 after reporting quarterly profits that met forecasts.

Semiconductor capital equipment stocks fell after J.P. Morgan Chase & Co. lowered its investment rating on several stocks, saying that a drop in capital investment stemming from the Sept 11. attacks would delay the ailing sector's recovery. KLA dropped to $32.70 from a close of $32.92, and Applied Materials fell to $30.80 from a close of $31.15. 

American Express Co. rose to $29.80 from a close of $29 after a federal judge on Tuesday told top U.S. credit card networks Visa and MasterCard that they must let their member banks issue rivals' cards. 

Advancing issues led decliners 2 to 1 on the New York Stock Exchange. Volume came to 1.29 billion shares, compared with 1.18 billion Tuesday.

The Russell 2000 index gained 12.98 to 421.66. 

Overseas, Japan's Nikkei stock average dropped 0.5 percent. European stocks fared better. Germany's DAX index gained 3.2 percent, Britain's FT-SE 100 rose 2.9 percent, and France's CAC-40 advanced 3.4 percent.

Reuters and the Associated Press contributed to this report.