Updated from 4:16 p.m. EST

Major stock averages gave up their gains in the last hour of trading Thursday, as better-than-expected economic data couldn't keep blue chips and tech shares from closing near the flat line.

The Dow Jones Industrial Average tacked on 12.76 points, or 0.1%, to 13,056.72. For a second straight session, Intel ( INTC) was the weakest component on the Dow, falling 2.7%.

The S&P 500 was unchanged at 1447.16. The Nasdaq Composite was the weakest performer, fluctuating between positive and negative territory all day before ending down 6.95 points, or 0.27%, at 2602.68.

Helping the Dow and S&P advance early was the ADP report on employment, which said private payrolls exceeded forecasts with a rise of 40,000 in December. Despite the report's short history and somewhat spotty record, traders viewed it as positive ahead of the government's own nonfarm payrolls numbers, due Friday.

But by the late afternoon, investors grew a bit jittery ahead of the Labor Department report, and the momentum faded.

"It's disturbing we couldn't retrace much of yesterday's decline," said Art Hogan, chief market analyst with Jefferies. "There's a lot of nervousness over tomorrow's nonfarm payrolls number. If we do get a downside surprise, that number combined with the weak manufacturing data we got yesterday will show a slowing economy and will not be good for stocks going forward."

Additionally, initial jobless claims fell by 21,000 last week to 336,000 claims, compared with economists' forecasts for 345,000.

U.S. Treasury prices were mixed following reports. The 10-year note tacked on 3/32 in price, yielding 3.90%. The 30-year bond fell 8/32, pushing the yield up to 4.37%.

The government's jobs report could be a key factor in the Federal Reserve's decision on interest rate policy when the central bank meets for a two-day meeting at the end of the month. Current projections are that the U.S. economy added 70,000 jobs last month. Any number that falls short of that mark may place a further strain on equity markets.

"The continued decline in help-wanted and the strengthening upward trend in jobless claims suggest that it is now just a matter of a very few months before the first negative payroll numbers start to appear," said Ian Shepherdson, chief economist with High Frequency Economics. "Nothing is better at keeping the Fed easing than falling payrolls."

Buyers also kept an eye on oil prices, which notched an intraday record of $100.09 a barrel. Crude first hit the century mark during the previous session due to geopolitical news out of Nigeria. Prices pulled back, though, and were down 44 cents to $99.18 a barrel.

Oil's weak close follows the Energy Department's weekly inventory report, which was delayed by a day due to the New Year's holiday. The release showed a decline of 4 million barrels in crude inventories last week. Gasoline stocks rose by 1.9 million barrels, and distillate inventories were up 600,000 barrels.

"It's bothersome if oil stays at this level, but this rise hasn't been caused by recent supply and demand," said Hogan. "The concerns over disruptions of supplies due to the violence in Nigeria probably won't have a long-term effect. We're looking at something that is transitory and we should seek a lower level over the near term."

Gold futures rallied to near-record levels, up $9.10 to close at $869.10 an ounce. Silver was also higher, up 21 cents to $15.50 an ounce.

Breadth was mixed. On the New York Stock Exchange 3.35 billion shares changed hands, as advancers edged decliners by a 6-to-5 margin. Volume on the Nasdaq reached 1.87 billion shares, with losers outpacing winners nearly 3 to 2.

Also on the economic docket, the Commerce Department said November factory orders rose 1.5%, topping the 1% estimated increase.

In corporate news, automakers released sales data for December. Ford ( F) said sales fell 9.2% last month. General Motors ( GM) posted a 4.4% decline in light-vehicle sales. Toyota Motor ( TM) surpassed Ford as 2007's No. 2 automaker, with a 1.7% decrease in sales.

Shares of Ford lost 2.3% and GM shed 2%. Toyota eked out a gain of 0.4%.

On the earnings front, Monsanto ( MON) posted a first-quarter profit that nearly tripled year-ago results, handily beating Wall Street's estimates. Shares gained $9.18, or 8.2%, to $120.65.

After the closing bell, Bed Bath & Beyond ( BBBY) and Finish Line ( FINL) were due to post quarterly results.

Elsewhere, ConocoPhillips ( COP) closed higher by 0.5% to $88.33 after saying its fourth-quarter production should increase from the third quarter.

Overseas markets were mixed following the decline in the U.S. on Wednesday. Overnight in Asia, Hong Kong's Hang Seng fell 2.4%. In Europe, London's FTSE 100 added 1%, while Germany's Xetra Dax slid 0.5%.