The consumer price index, which covers a variety of goods and services, rose 0.4 percent, compared with a 0.1 percent increase the previous month.
May was the fourth straight month that the index rose, after three straight monthly declines caused by lower oil prices.
But a reversal in gas prices has increased inflationary pressure. The gas price index rose 10.4 percent in May after declining 1.7 percent the previous month.
The increase in gas prices was the main factor in the overall rise of the consumer price index, a closely watched measure of inflation.
Taking out volatile energy and food prices, so-called core prices rose 0.1 percent, the smallest increase since December. Food prices were unchanged in May for the second straight month.
A steep decline in oil prices that began last year has pushed inflation extremely low. Despite the rise in May, gas prices were down 25 percent from a year earlier.
For the 12 months ended May 31, overall consumer prices were unchanged, the Labor Department said. Still, that’s an improvement over the 0.2 percent annual decline through April.
Federal Reserve policymakers are watching inflation as they decide when to raise a key short-term interest rate for the first time since 2006. The Fed wants about 2 percent annual inflation.
The Fed uses a different annual inflation measure, based on personal consumption expenditures, that was up 0.1 percent in April, the latest data available.
Excluding food and energy, core consumer prices were up 1.7 percent in the 12 months ended May 31. The figure was down from 1.8 percent in April.