Stocks climbed yesterday after companies including Starbucks raised their annual profit forecasts. The gains pushed the Nasdaq composite index to a four-year high along with the Standard & Poor's 500-stock index.

"The market is going to continue this near-term rally," said Barry Hyman, equity strategist at Ehrenkrantz King Nussbaum in New York. "Earnings are the story. That is the ultimate driver of stocks."

The S&P 500 gained 6.93, to 1243.72, led by companies that sell mainly to consumers and health care shares. The Nasdaq rose 12.22, to 2198.44. The two indexes closed at levels not seen since June 2001. The Dow Jones industrial average rallied 68.46, to 10,705.55. All three benchmarks rose 0.6 percent.

Better-than-expected profits and economic reports have pushed the S&P 500 up 4.4 percent this month and wiped out its loss for the year. The Dow average has gained 4.2 percent in July. Both are headed toward their best monthly performances since December 2003. The Nasdaq has rallied 6.9 percent.

Of the 352 companies in the S&P 500 that have released quarterly earnings, 70 percent beat expectations, the highest rate since the first quarter of 2004, according to Bloomberg data based on estimates compiled by Thomson Financial.

Movers

Starbucks climbed $2.33, to $52.68. The largest U.S. coffee shop chain expects 2005 per-share profit of $1.19 to $1.20, up from a previous forecast of $1.17 to $1.19. Third-quarter results beat estimates.

UnitedHealth Group, the No. 2 medical insurance provider, rose $1.50, to $52.92. On Wednesday, WellPoint, the largest U.S. health insurance provider, raised its 2005 earnings forecast and said it expects medical costs to increase less this year. WellPoint advanced $3.40, to $70.50.

Caterpillar, the world's biggest maker of earthmoving equipment, climbed $1.66, or 3.1 percent, to $54.45, for the best performance in the Dow average.

Andrew Corp. dropped $2.63, or 18.9 percent, to $11.30, for the worst performance in the S&P 500. The designer of communications equipment said fiscal fourth-quarter profit will be 4 cents to 7 cents a share, lower than expectations.

Indexes

New York Stock Exchange composite index rose 51.34, to 7516.78.

American Stock Exchange index rose 18.44, to 1585.41.

Russell 2000 index of smaller-company stocks rose 12.26, to 683.04.

Volume

NYSE: 2.02 billion shares, up from 1.99 billion on Wednesday. Advancers outnumbered decliners

14 to 5.

Nasdaq: 1.71 billion shares, down from 1.78 billion. Advancers outnumbered decliners 7 to 4.

Commodities

Crude oil for September delivery: $59.94, up 83 cents.

Gold for current delivery: $427.40 a troy ounce, up from $424.70 on Wednesday.