WASHINGTON (AP) — U.S. inflation slowed last month and a measure of underlying price pressures also cooled, suggesting higher oil and gas prices from the Iran war are only having a limited impact on broader costs in the economy.

Consumer prices rose 3.4% in July from a year ago, down slightly from 3.5% in June, the Labor Department said Wednesday. But inflation is still higher than before the Iran war began in February, when it was 2.4%. On a monthly basis, prices rose just 0.1% from June to July.

READ MORE: U.S. stocks edge further from their records as oil prices keep swinging

The modest decline could ease pressure on the Federal Reserve to raise their key interest rate to combat rising costs. Yet prices are still rising more quickly than average wages, underscoring the struggle many Americans have had with more expensive groceries, gas, and healthcare, trends that have taken on a high profile in the fast-approaching midterm elections.

Excluding the volatile food and energy categories, core inflation also slipped to 2.5% in July from a year ago, down from 2.6% in June. July's figure matches a post-pandemic low reached in January and February, before the Iran war.