WASHINGTON — Consumer prices were unchanged in June, held down by cheaper gas. Outside the volatile food and energy categories, inflation was mild.

Weak economic growth is limiting the ability of companies to raise prices. The tame inflation was underscored by a 0.2 percent drop in consumer prices for the April-June period as a whole. That was the first quarterly drop in consumer prices in two years.

In May, the consumer price index fell 0.3 percent. In April, it was unchanged.

In its report Tuesday, the Labor Department said gas prices fell a seasonally adjusted 2 percent in June, the third straight decline. Food prices edged up 0.2 percent.

Excluding the volatile food and energy categories, “core” prices rose 0.2 percent last month. It was the fourth straight increase of that size. But some analysts think core prices will begin to slow.

“With the economic recovery stalling and the unemployment rate still elevated, we would expect core inflation to ease soon,” Paul Ashworth, an economist at Capital Economics, said in a note to clients.

Mild price increases leave consumers with more money to spend, which could spur more growth. Lower inflation also gives the Federal Reserve room to launch new programs intended to boost the economy.

Over the past 12 months, consumer prices are up 1.7 percent. That matches the increase for the 12 months that ended in May — the smallest increase in more than a year. It’s also below the Fed’s inflation target of 2 percent.

Core prices have risen 2.2 percent over the past year.