The Standard & Poor's 500-stock index and the Nasdaq composite index climbed to four-year highs again as companies continued to post better-than-expected profits and government reports showed an expanding economy.

"Earnings growth has been strong," said Michael G. Odlum, chief investment officer at Security Benefit Group, which manages $14.5 billion in Topeka, Kan. "The backdrop is positive for stocks over the next six months because I think the economy will continue to surprise and exasperate economists who are still expecting it to weaken."

The S&P 500 gained 8.77, or 0.7 percent, to 1244.12, and the Nasdaq rose 22.77, or 1 percent, to 2218.15, levels not seen since June 2001. The S&P 500 set a new four-year high for the sixth time since July 14. The Dow Jones industrial average advanced 60.59, or 0.6 percent, to 10,683.74.

Personal incomes rose 0.5 percent in June after a 0.2 percent increase the previous month, the Commerce Department said. Personal spending jumped 0.8 percent following no change in May. Factory orders climbed for a fourth month in June, expanding 1 percent.

Movers

Maxim Integrated Products gained $3.49, or 8.3 percent, to $45.50. The maker of semiconductors for consumer electronics said first-quarter sales will be "at least 4 percent higher" than the previous period.

Microsoft, the world's largest software maker, jumped 89 cents, to $26.81, a seven-month high. It was the biggest contributor to the S&P 500's gain. Intel, the No. 1 maker of computer chips, gained 45 cents, to $27.56.

Chevron increased $1.13, to $59.56. China's Cnooc dropped an $18.5 billion takeover offer for Unocal, clearing the way for Chevron to buy the oil and gas producer. Cnooc's U.S. shares jumped $4.15, to $73.49. Unocal gained 16 cents, to $64.53.

Comcast advanced 39 cents, to $31. The cable television industry leader said second-quarter sales increased to $5.6 billion, beating analysts' estimates.

Eli Lilly fell 68 cents, to $56.01. The drugmaker said it won't seek U.S. approval to use its Arxxant drug to treat nerve damage in diabetics after two studies showed the treatment wasn't effective for that use.

Indexes

New York Stock Exchange composite index rose 54.49, to 7556.59.

American Stock Exchange index rose 16.83, to 1629.71.

Russell 2000 index of smaller-company stocks rose 5.71, to 688.51, a new high.

Volume

NYSE: 2.05 billion shares, up from 1.73 billion on Monday. Advancers outnumbered decliners 2 to 1.

Nasdaq: 1.76 billion shares, up from 1.48 billion. Advancers outnumbered decliners 3 to 2.

Commodities

Crude oil for September delivery: $61.89, up 32 cents.

* Gold for current delivery: $431.90 a troy ounce, unchanged from Monday.