Stocks edged lower on Thursday, hurt by a slide in drugmaker Merck and as falling commodities prices hit shares of natural resource companies.

The S&P 500, however, held near 28-month highs as investors saw stocks' upward trend continuing, focusing on expectations for strong earnings.

Intel Corp confirmed those bets as it posted better-than-expected quarterly earnings and forecast strong revenue for the coming quarter after the closing bell. Its shares rose 2.7 percent to $21.87 following a 0.06 percent dip during regular trading hours.

During Thursday's session copper prices retreated from recent highs on concerns of slowing demand from China. Freeport McMoRan Copper & Gold lost 3.1 percent to $118.07, and the S&P materials sector <.GSPM> fell 0.8 percent.

The fact the commodities market is trading down is what's putting pressure on materials shares, said Tom Schrader, managing director of U.S. equity trading at Stifel Nicolaus Capital Markets in Baltimore.

Merck & Co dropped 6.6 percent to $34.69, accounting for more than half the losses in the Dow industrials, after it stopped giving a blood clot preventer, one of its most important experimental drugs, to some patients.

The S&P healthcare index <.GSPA> fell 0.54 percent.

Weekly initial jobless claims jumped to their highest level since October last week while food and energy costs lifted producer prices in December, pointing to headwinds for an economy that has shown fresh vigor.

A surge in exports to their highest level in two years helped narrow the U.S. trade deficit in November, an encouraging sign for positive surprises in the current earnings season.

The Dow Jones industrial average <.DJI> fell 23.54 points, or 0.20 percent, to 11,731.90. The Standard & Poor's 500 Index <.SPX> dropped 2.20 points, or 0.17 percent, to 1,283.76. The Nasdaq Composite Index <.IXIC> dipped 2.04 points, or 0.07 percent, to 2,735.29.

The benchmark S&P 500 has gained 22.3 percent since the start of September.

About 7.57 billion shares traded on the New York Stock Exchange, the American Stock Exchange and Nasdaq, below last year's estimated daily average of 8.47 billion.

Advancing stocks trailed declining ones on the NYSE by 1,363 to 1,622, while on the Nasdaq, more than 5 stocks fell for every four that rose.

JPMorgan fell 0.6 percent to $44.45 ahead of its results, expected before the market's open on Friday. Its shares have risen 4.8 percent so far this year.

Earnings from S&P 500 companies are expected to rise 32 percent in the fourth quarter compared to a year ago.

Despite Intel's beat and the rise in its shares, S&P 500 futures were flat late Thursday. In the previous two quarters when the technology bellwether beat Wall Street estimates, the broad U.S. stocks benchmark ended the sessions in the opposite direction as Intel shares.

Marathon Oil Corp gained 6 percent to $42.98 after it said it would spin off its refinery and pipeline operations into a stand-alone company.

Easing recent worries about the credit crisis in Europe, Spain and Italy followed Portugal with successful debt sales on Thursday. The euro rose 1.7 percent against the U.S. dollar, its best day in six months.

(Reporting by Rodrigo Campos; additional reporting by Chuck Mikolajczak and Pedro Nicolaci da Costa; Editing by Kenneth Barry)