U.S. stocks rose, led by energy companies including Exxon Mobil, as the price of crude oil surged to a record in the wake of terrorist attacks in Saudi Arabia, the world's largest oil exporter.

"Higher sustainable oil prices would be favorable for companies in the energy sector," said Brett Gallagher, who helps manage $9 billion as head of U.S. equities at Julius Baer Investment Management in New York. "Spending on oil services and equipment would have to increase."

Transportation stocks such as Delta Air Lines, whose fuel costs rise with the increase in oil prices, slumped.

The Standard & Poor's 500-stock index gained 0.52, or 0.05 percent, to 1121.20. The Dow Jones industrial average advanced 14.20, or 0.1 percent, to 10,202.65. The Nasdaq composite index rose 4.03, or 0.2 percent, to 1990.77.

The benchmarks reached their highest levels of the day after a gauge of U.S. manufacturing unexpectedly increased in May. The Institute for Supply Management's factory index rose to 62.8, beating the 61.5 estimate from a Bloomberg News survey. A reading greater than 50 signals expansion. The index, which had a reading of 62.4 in April, has exceeded 60 for seven months.

The benchmarks turned lower on concerns about higher energy prices, falling as much as 0.7 percent, before erasing their losses in the final 30 minutes of trading.

"The stronger-than-expected economic data we saw earlier today have enabled the markets to shrug off the higher oil prices," said Todd Clark, head of listed trading at Wells Fargo Securities.

In New York, crude oil for July delivery jumped 6.1 percent, to $42.33 a barrel, on the first day of trading since attacks in Saudi Arabia killed 22 people on Saturday. An index of energy stocks rose 1.3 percent, for the largest gain among the S&P 500's 10 industry groups. Exxon advanced 45 cents, to $43.70. ConocoPhillips, the top U.S. oil refiner, climbed $1.88, to $75.21.

An index of transportation companies lost 1.1 percent as the jump in oil and gas prices threatens to boost their costs. Delta sank 41 cents, or 6.7 percent, to $5.69, for the steepest drop in the S&P 500. US Airways Group fell 24 cents, or 9.2 percent, to $2.37. Southwest Airlines slid 15 cents, to $15.36. FedEx, the world's biggest overnight package-delivery company, dropped 76 cents, to $72.82.

An index of computer-related companies dropped 0.3 percent, the biggest decline among the S&P 500's 10 industry groups. Microsoft fell 12 cents, to $26.11. International Business Machines declined 47 cents, to $88.12. Cisco Systems fell 13 cents, to $22.24.

Other Indicators

* The New York Stock Exchange composite index rose 2.53, to 6487.25; the American Stock Exchange index rose 4.99, to 1203.10; and the Russell 2000 index of smaller-company stocks rose 4.21, to 572.49.

* Advancing issues narrowly outnumbered declining ones on the NYSE, where trading volume rose to 1.23 billion shares, from 1.17 billion on Friday. On the Nasdaq Stock Market, advancers outnumbered decliners by 6 to 5 and volume totaled 1.43 billion, up from 1.2 billion.

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

* The dollar rose against the Japanese yen and fell against the euro. In late New York trading, a dollar bought 110.59 yen, up from 110.25 late Friday, and a euro bought $1.2232, up from $1.2213.

* Light, sweet crude oil for July delivery settled at $42.33, up $2.45, on the New York Mercantile Exchange.

* Gold for current delivery rose to $394.60 a troy ounce, from $394.00 on Friday, on the New York Mercantile Exchange's Commodity Exchange.