Updated

Stocks climbed for the third straight day Thursday amid generally good earnings reports, but blue-chip stocks meandered in and out of positive range as investors digested high oil prices and brokerage downgrades of General Motors Corp.(GM).

The Dow Jones industrial average (search) rose 12.17 points, or 0.12 percent, to close at 10,129.24, after swinging during the day from a low of 10,084.84 to a high of 10,163.01. The Standard & Poor's 500 Index (search) was up 5.01 points, or 0.46 percent, at 1,100.43, after falling as low as 1,095.42 during the session.

The technology-laced Nasdaq Composite Index (search) advanced 22.80 points, or 1.23 percent, to finish at 1,881.06, based on the latest data. During the session, the Nasdaq fell as low as 1,867.62 and touched a high at 1,885.01.

Stocks were flat to moderately higher through much of the session, but few analysts believed there was much conviction in the day's buying. The equity markets have traded in a narrow band for more than a month amid growing nervousness about slower second-half growth and the potential for terror attacks ahead of the presidential election and the Olympics.

"We haven't had much of a follow-through today. I imagine it won't be long before we retest the lows," said David Hegarty, head trader at Commerzbank Securities. "To make us go higher from here ... we're going to have to have some sort of chatter, some sort of guidance for '05 that things will look better."

Crude oil was the main concern of the day.

Oil, a vital ingredient in the production of most goods and services as well as transport, hurts profits at most companies whenever the price soars.

Wednesday's surge in oil prices, when the price of U.S. light crude jumped to $43.05 a barrel -- the highest in the New York-traded contract's 21-year history -- caused worries in the markets.

Some relief came earlier Thursday as the price of U.S. light crude eased after Russia lifted the threat of a halt to oil sales by the country's largest oil firm YUKOS.

On the New York Mercantile Exchange (search), September crude fell 15 cents to settle at $42.75.

"The Dow seems to follow the price of oil, and the price of oil on an hour-to-hour basis is now the key trading factor," said Larry Wachtel, senior vice president and market analyst at Wachovia Securities.

"But we've been down for six weeks so this three-day rally is simply the law of physics -- the rubber band snapping back. That doesn't mean we're in a brave new world, but we can't go down forever and ever. We have to have some relief."

In economic news, the Labor Department (search) reported a moderate 0.9 percent rise in wages and benefits for U.S. workers in the April-June quarter, down slightly from the previous quarter's increase. In a second report, the department said new claims for unemployment benefits edged up slightly last week, though they remain at a level that suggests continued labor market improvement.

Trading was light Thursday, which analysts attributed in part to anticipation of the government's gross domestic product report, due Friday.

"I think tomorrow is a big day ... nobody wants to be out in front of that," said Michael Murphy, head trader at Wachovia Securities in Baltimore. "The economy is very much on investors' minds. It's a trigger point. If it's a bad number, I think we'll see a sell-off, but if it's a good number we'll probably celebrate."

Exxon, health insurer Aetna (AET) and chemical maker Dow Chemical Co. (DOW) posted higher earnings on Thursday. Semiconductor stocks such as Intel Corp (INTC) and fiber-optic component maker JDS Uniphase Corp. (JDSU) gave a boost to the Nasdaq, which was fueled by strong results from smaller industry players like MEMC Electronic Materials Inc. (WFR).

But a brokerage downgrade on car maker General Motors (GM) capped gains on the Dow. Goldman Sachs said it cut its rating on GM to "underperform" from "in-line" due to its expectations that it will miss earnings forecasts in either 2004 or 2005 by a wide margin. GM fell $1.47, or 3.33 percent, to $42.65 on the New York Stock Exchange.

Exxon Mobil (XOM) — the world's largest publicly traded oil company — was up 22 cents at $46.03, after matching Wall Street's earnings estimates, reporting a 39 percent jump in profits on higher prices for oil and natural gas.

Krispy Kreme Doughnuts, Inc. (KKD) was down 16 percent, or $2.95, at $15.71, after disclosing it is the subject of an "informal, nonpublic inquiry" by the Securities and Exchange Commission (search). The probe is focused on the company's franchise reacquisitions and its guidance on a reduction in earnings, Krispy Kreme said.

MetLife Inc. (MET) added $1.23 to $35.53 after reporting a 45 percent gain in second quarter profits, soaring past Wall Street's forecasts, as higher premiums and profitable investments helped boost revenues across all business segments. The company also disclosed that the Internal Revenue Service is auditing its returns for the years 1997-1999.

JDS Uniphase Corp. (JDSU) helped strengthen the technology-laden Nasdaq after it posted on Wednesday a smaller quarterly loss versus a year ago. Its shares gained 44 cents, or 15 percent, to $3.44.

Investors returned to semiconductor stocks, with Intel (INTC) rising 3.33 percent, or 78 cents, to $24.24, and Applied Materials Inc. (AMAT) gaining 3.78 percent, or 60 cents, to $16.46.

Volume was active, with about 1.53 billion shares changing hands on the New York Stock Exchange and about 1.69 billion traded on the Nasdaq.

The Russell 2000 index, which tracks smaller company stocks, was up 8.63, or 1.6 percent, at 549.83.

Overseas, Japan's Nikkei stock average finished 0.8 percent lower Thursday. In Europe, France's CAC-40 added 1.9 percent, Britain's FTSE 100 gained 1.4 percent and Germany's DAX index closed up 2.2 percent.

Reuters and the Associated Press contributed to this report.