US consumer prices rose slightly in July, extending a slow year-over-year rise since April as the Federal Reserve plans an interest rate increase this year, official data has shown.

The country’s Labor Department said its consumer price index rose 0.1% in July, slowing from a 0.3% gain in June and the smallest monthly increase since April.

Food prices rose 0.2%. Energy prices were up 0.1%, led by a 0.9% rise in gasoline prices that offset declines in other components, including fuel oil.

Excluding food and energy, which tend to be volatile month on month, core CPI also rose 0.1%, down from 0.2% in June.

But on a 12-month basis, consumer prices were up 0.2%, building on a gain since April. Core CPI year-on-year was roughly steady at 1.8%.

The Federal Reserve's target for price stability is 2% inflation over the longer term. 

The central bank's preferred inflation measure, the personal consumption expenditures price index, increased 0.3% in June compared with a year ago, and excluding food and energy, was up 1.3%.