U.S. producer prices rose by less than expected in May despite a jump in gasoline costs, government data on Tuesday showed, while prices compared with a year ago notched their steepest fall since 1949.

The Labor Department said the seasonally adjusted index for prices paid at the farm and factory gate increased 0.2 percent after a 0.3 percent April rise.

Analysts polled by Reuters had expected producer prices to be 0.6 percent higher last month.

Compared with the same period last year, producer prices fell 5 percent for the largest decline since August 1949.

Core producer prices, which exclude food and energy costs, dropped 0.1 percent in May compared with a forecast for a 0.1 percent rise. This was the largest decline in monthly core producer prices since October 2006, when they fell 0.5 percent.

In contrast with May 2008, core producer prices stood 3 percent higher.

The Labor Department said that a 2.9 percent rise in finished energy goods more than offset a 1.6 percent decline in the index for finished consumer foods for the change in overall producer prices. Gasoline prices rose 13.9 percent

(Reporting by Alister Bull; editing by Neil Stempleman)