Stocks pared earlier gains and turned negative on Wednesday, led lower by materials and energy shares.

The Dow Jones industrial average <.DJI> was down 40.07 points, or 0.31 percent, at 12,965.05. The Standard & Poor's 500 Index <.SPX> was down 4.42 points, or 0.32 percent, at 1,367.76. The Nasdaq Composite Index <.IXIC> was down 11.53 points, or 0.39 percent, at 2,975.23.

(Reporting By Angela Moon; editing by Jeffrey Benkoe)