The prices U.S. companies receive for their goods and services fell in May, offering evidence that inflation is mild.

The producer price index, which measures the cost of goods and services before they reach the consumer, dropped 0.2% last month, the Labor Department said Friday. The decline was driven lower by cheaper food and gas, and follows two months of strong gains that had suggested inflation might be perking up after being dormant for two years.

In the past 12 months, producer prices have risen 2%, matching the Federal Reserve's inflation target. That's down from an annual gain of 2.1% in April.

Wholesale food prices fell 0.2% after four months of steep increases. And wholesale gas prices dropped 0.9%, suggesting consumers may see some relief at the gas pump in coming months.

Another reason producer prices fell: retailer and wholesaler profit margins declined 0.5% after two months of strong gains. Excluding the volatile food, energy and profit margin categories, core producer prices were unchanged in May and also rose 2% in the past year.

The drop in profit margins comes after strong gains in April and March. Retailer and wholesaler profit margins had fallen in the winter as companies rolled out discounts to lure shoppers through the doors during harsh winter storms.

Wholesale prices rose 0.6% in April and 0.5% in May. Some of those increases have been passed onto consumers. The consumer price index, the most widely followed inflation measure, rose 2% in April compared with 12 months earlier. That was the largest yearly increase since July.

The Federal Reserve prefers inflation at about 2% as a guard against deflation, which occurs when prices actually fall. Deflation can also drag down wages and typically leads to recessions.

Inflation, as measured by the consumer price index, has been mostly below 2% for the past two years.

Consumers may like low prices, but weak inflation also occurs when the economy is sluggish. Wage growth has been meager for the past four years, and unemployment remains at historically high levels. That limits consumer spending and makes it harder for businesses to raise prices.

Still, low inflation has enabled the Fed to pursue extraordinary stimulus programs to try and boost the economy. It has begun to unwind some of that stimulus, cutting its monthly bond purchases to $45 billion from $85 billion last year.

The bond purchases, intended to lower long-term interest rates, are expected to be trimmed by another $10 billion when Fed officials meet again next week.