U.S. producer prices rose by a more-than-expected 0.6 percent in July, Labor Department data on Tuesday showed, but the gain was driven by energy costs and core inflation at the producer level grew only slightly.

Economists polled by Reuters forecast producer prices — a gauge of the prices paid at the farm and factory gate — would rise 0.2 percent last month from an unrevised 0.2 percent fall in June.

Stripping out volatile food and energy costs, producer prices advanced 0.1 percent, less than the 0.2 percent increase forecast, following an unrevised 0.3 percent rise in June. On a year-on-year basis, core producer prices were up 2.3 percent, the largest gain since a 2.6 percent increase in September 2005, the Labor Department said.

Core producer prices excluding the price of cars and light trucks were unchanged, a Labor Department official said. Gasoline prices jumped 3.2 percent in July.

"The market is only going to care about the core (PPI figure), which is better than expected. I don't think it does much to stocks. 0.1 is a good number and probably keeps the Fed happy with where they are now," said Robert Macintosh, chief economist at Eaton Vance Management in Boston.

Producer prices were released one day ahead of July's reading on U.S. consumer inflation, which will be watched closely by the Federal Reserve.

The U.S. central bank said last week that inflation was its predominant concern, when it held interest rates steady at 5.25 percent. But financial market turmoil since then sparked by fears over the availability of credit may have dimmed this threat and could dampen growth.