WASHINGTON (AP) — Inflation was unchanged in July as rising prices for some imported goods were balanced by falling gas and grocery prices, leaving overall prices modestly higher than a year ago.

Consumer prices rose 2.7 percent in July from a year earlier, according to new figures from the Labor Department. That’s the same rate as the previous month.

Excluding the volatile food and energy categories, core prices rose 3.1 percent, up from 2.9 percent in June. Both figures are above the Federal Reserve’s 2 percent target.

On a monthly basis, prices rose 0.2 percent in July, down from 0.3 percent the previous month, while core prices ticked up 0.3 percent, a bit faster than the 0.2 percent in June.

Gas prices fell 2.2 percent from June to July and have plunged 9.5 percent from a year earlier, the government’s report said. Grocery prices slipped 0.1 percent last month, though they are still 2.2 percent higher than a year ago.

Shoe prices jumped 1.4 percent from June to July, though they are still just 0.9 percent more expensive than a year ago. The cost of furniture leapt 0.9 percent in July and is 3.2 percent higher than a year earlier.

Coffee costs nearly 15 percent more than a year earlier, mostly because of troubled harvests overseas, though steep duties on imports from Brazil could push those prices higher in the coming months. Nearly all coffee consumed in the United States is imported.

Brian Bethune, an economist at Boston College, said that overall, President Donald Trump’s new tariffs — calculated as the amount of duties paid by American companies divided by overall imports — have reached 10 percent, the highest in decades, and will likely keep rising for months.

“Those cost increases will be passed on to the consumer in some way, shape, or form,” Bethune said. Some companies could return to “shrinkflation,” he added, in which they reduce the package size of a good while keeping the price the same.