By Amara Omeokwe

WASHINGTON -- U.S. consumer prices rose sharply in June while states were broadening efforts to reopen, with costs snapping back for products and services that were hit hard by the coronavirus pandemic.

The consumer-price index -- which measures what Americans pay for everyday items including groceries, clothing and shelter -- rose 0.6% in June, the Labor Department said Tuesday. The index had fallen in each of the previous three months, with particularly sharp declines during the earlier part of the pandemic in March and April.

"June represented the beginning of a return to normal for prices, as most of the categories that had been depressed by the COVID lockdowns rebounded once the economy started to recover in earnest," said Stephen Stanley, chief economist at Amherst Pierpont, in a note to clients, referring to the illness caused by the coronavirus.

The longer trend showed inflationary pressures remained modest. Prices overall rose 0.6% in June from the same month in 2019, compared with a 0.1% year-over-year increase in May. So-called core prices, which exclude the often-volatile categories of food and energy, increased 1.2% over the year, unchanged from the increase the previous month.

Apparel prices increased 1.7% in June, after three previous months of steep declines, as bricks-and-mortar retail stores reopened. Prices for medical-care services, airline fares and hotel stays all rose sharply over the month, reflecting greater activity in doctors' offices and in the hard-hit travel and hospitality sectors.

Gasoline prices, which rose 12.3% last month, also drove the gains and accounted for more than half of the monthly increase in overall prices, according to the Labor Department. Core prices rose 0.2% in June, compared with a 0.1% decline in May.

Tuesday's report also showed another strong increase in grocery prices, albeit at a lower level than in the previous two months. The cost of groceries rose 0.7% last month, after a 2.6% and 1% monthly rise in April and May, respectively. Grocery stores have seen strong demand, as consumers stayed home and restaurants limited capacity or closed in response to the pandemic.

Prices for dining out also rose in June, by 0.5%, the biggest monthly gain so far in 2020.

Gus Faucher, chief economist at PNC Financial Services, said the gain in overall prices last month should ease deflation fears stoked by a steep drop-off in consumer demand as the pandemic's effects first rippled through the U.S. economy.

Deflation is "one less thing to worry about and it's indicative of the fact that demand has picked up and businesses have the ability to raise prices a little bit," Mr. Faucher said.

Still, the outlook for prices and the broader economic recovery is clouded by a recent jump in coronavirus cases, which has caused some states to reimplement restrictions. California, for instance, on Monday banned indoor activities at restaurants, bars, museums and movie theaters.

"Obviously, if we see more widespread closures, that's going to reduce demand for goods and services throughout the economy and that could lead to a return in price declines," Mr. Faucher said, adding downward pressure on prices was likely to be isolated to specific industries and geographic areas.

Write to Amara Omeokwe at amara.omeokwe@wsj.com