Prices charged by U.S. producers rose at the fastest pace in four months, driven higher by the biggest monthly increase in energy prices in a year.

The Labor Department says its producer price index, which measures inflation pressures before they reach the consumer, increased 0.4 percent in May after a 0.2 percent rise in April. It was the biggest gain since a similar 0.4 percent increase in January. Prices at the wholesale level had fallen in both February and March.

Core inflation, which excludes energy and food, was up 0.3 percent in May, an acceleration from a modest 0.1 percent rise in April, indicating that inflation, which has been running below the Federal Reserve's preferred 2 percent pace, could be starting to accelerate.