U.S. stocks rose as the price of oil retreated, helping benchmark indexes recover from disappointing profit forecasts by companies such as 3M.

"The reason we are not lower is because of oil," said Corey Geog, head trader at State Teachers Retirement System of Ohio, which oversees $54.2 billion in Columbus. "We will need earnings to sustain this. To get any trend, it has to be about earnings, it has to be about the economy."

Crude oil for November delivery dropped $1.26, or 2.3 percent, to $53.67 a barrel on the New York Mercantile Exchange, after reaching a record $55.33 earlier in the day.

The Standard & Poor's 500-stock index gained 5.82, or 0.5 percent, to 1114.02. The Nasdaq composite index rose 25.02, or 1.3 percent, to 1936.52, its biggest rally in two weeks. The Dow Jones industrial average increased 22.94, or 0.2 percent, to 9956.32.

3M shares limited the Dow's advance, slumping $1.88, to $76.10, after the company's projection for full-year profit fell below analysts' estimates.

Pharmaceutical shares advanced, led by Pfizer, which rebounded from a two-year low. The world's largest drugmaker said it plans to study possible heart benefits of its arthritis drug Celebrex, a painkiller similar to Merck's Vioxx, recalled last month. Pfizer gained 50 cents, to $29. The stock closed Friday at its lowest since October 2002.

Johnson & Johnson climbed 74 cents, to $57.32. The company said Remicade, a treatment for a type of arthritis, provided 70 percent or more improvement in symptoms of arthritis in 27 percent of patients, compared with 2 percent of patients using a placebo.

MedImmune, the maker of the FluMist nasal spray influenza vaccine, gained $1.81, to $28.13.

Check Point Software Technologies jumped $3.18, to $21.10, after its profit topped analysts' estimates. Microsoft gained 42 cents, to $28.41. The world's biggest software maker reports earnings on Thursday. Oracle, the number-three maker of business software, rose 18 cents, to $12.42.

IBM, the world's largest computer maker, rose $1.07, to $85.92. After the market closed, the company reported third-quarter profit, excluding some costs, of $1.17 a share, beating the $1.14 average analyst estimate in a Thomson Financial survey.

Disappointing earnings from the world's two biggest toymakers sent their shares lower. Mattel, the largest toymaker, dropped 47 cents, to $17.50. Third-quarter profit fell 5.2 percent to $255.9 million. Hasbro slid $1.20, to $17.26. Mattel's smaller rival had third-quarter profit of 45 cents a share, less than the 51 cents expected by analysts in a Thomson poll.

Marsh & McLennan, the world's largest insurance broker, fell $3.63, to $25.57. A shareholder sued directors on behalf of the company, claiming they failed to prevent alleged bid rigging that is the focus of a civil suit by New York Attorney General Eliot L. Spitzer.

Other Indicators

* The New York Stock Exchange composite index rose 12.99, to 6572.37; the American Stock Exchange index fell 4.27, to 1281.38; and the Russell 2000 index of smaller-company stocks rose 2.61, to 572.03.

* Advancing issues outnumbered declining ones by 6 to 5 on the NYSE, where trading volume fell to 1.37 billion shares, from 1.65 billion on Friday. On the Nasdaq Stock Market, advancers outnumbered decliners by 3 to 2 and volume totaled 1.49 billion, down from 1.62 billion.

* The price of the Treasury's 10-year note rose 63 cents per $1,000 invested, and its yield fell to 4.05 percent, from 4.06 percent on Friday.

* The dollar rose against the Japanese yen and fell against the euro. In late New York trading, a dollar bought 109.27 yen, up from 109.19 late Friday, and a euro bought $1.2501, up from $1.2480.

* Gold for current delivery fell to $416.20 a troy ounce, from $418.70 on Friday, on the New York Mercantile Exchange's Commodity Exchange.