WASHINGTON—U.S. consumer prices rose at a solid pace in June, but offered few signs of a breakout.

The consumer-price index, which measures what Americans pay for household items such as ice cream and services such as eye care, increased a seasonally adjusted 0.1% in June from the prior month, the Labor Department said Thursday.

Excluding the volatile food and energy categories, so-called core prices rose a stronger-than-expected 0.3% from May, the largest monthly rise since January 2018.

From a year earlier, consumer prices climbed 1.6% in June. Prices were up 2.1% on the year when excluding food and energy.

Prices for shelter, which account for about a third of all consumer prices, strengthened in June from the prior month, helping offset weakness in prices for food and energy.