U.S. stocks pared earlier gains as energy companies’ shares declined after a higher-than-expected increase in petroleum inventories and Monsanto Co. shares declined as its revenue fell short of expectations.

The S&P 500 Index declined 0.31 points, or 0.02 percent, to trade at 1,332.46 at 1:09 p.m. EDT. The Dow Jones Industrial Average advanced 20.74 points, or 0.17 percent, to trade at 12,414.64. The Nasdaq Composite Index fell 0.01 percent.

Energy sector stocks declined after a report showed that crude oil supplies rose by 2 million barrels in the past week against analysts’ estimation of 1.3 million barrels.

Peabody Energy Corp. (NYSE:BTU) declined 2.78 percent and First Solar Inc. (NASDAQ:FSLR) declined 2.97 percent, while Cameron International Corp. (NYSE:CAM) declined 2.61 percent.

Monsanto Co. (NYSE:MON) led declines in commodity producers after the company reported second quarter sales of $4.13 billion against analysts’ estimation of $4.15 billion. The company shares declined 4.9 percent to $69.73.

Earlier stocks advanced as German manufacturing orders for February came in better than expected and gold rallied to a new high.

German factory orders surged in February, mainly boosted by strong domestic demand. New factory orders in the eurozone’s largest economy rose 2.4 percent in February from an upwardly revised figure of 3.1 percent increase in the previous month.

The euro advanced 0.76 percent to 1.4330 against dollar amid expectations that the European Central Bank will raise interest rates for the first time in nearly three years Thursday.

Broadcom Corp. (NASDAQ:BRCM) advanced 3.12 percent to $39.65 as Oppenheimer has upgraded shares of BRCM to outperform from perform citing strong growth profile, management's stated efforts to pursue profitable growth, a more disciplined operating expense and compensation strategy.