WASHINGTON — Led by lower food and auto prices, inflation in the United States cooled slightly last month after three elevated readings, likely offering a tentative sigh of relief for officials at the Federal Reserve as well as President Joe Biden’s reelection team.

Consumer prices rose 0.3% from March to April, the Labor Department said Wednesday, down slightly from 0.4% the previous month. Measured year-over-year, inflation ticked down from 3.5% to 3.4%. And a gauge of underlying inflation, which excludes volatile food and energy costs, reached its lowest level in three years.

Inflation had been unexpectedly high in the first three months of this year after having steadily dropped in the second half of 2023. The elevated readings had dimmed hopes that the worst bout of inflation in four decades was being rapidly tamed.

Though hiring remains robust and wage growth, on average, healthy, consumer prices remain generally well above their pre-pandemic levels.

Wednesday’s report provides a dose of reassurance that the pace of price increases may be resuming its slowdown. While the latest figures show inflation still well above the Fed’s 2% target, it’s the first time this year that the year-over-year figure has declined. And price increases cooled in some service industries, such as hotels, health care and auto repairs, that had previously kept inflation elevated.

The report “was a tiny step in the right direction,” said Danielle Hale, chief economist at Realtor.com. “The fight against inflation is not yet over, but the worsening trend observed in the first quarter of 2024 may have ended.”

A separate report on retail sales, also released Wednesday, showed that Americans’ spending at stores and restaurants was unchanged in April after a healthy gain in March. A more restrained consumer could reassure the Fed that inflation will keep cooling.

Among individual items in April, grocery prices slipped, providing a break to shoppers. Egg prices, which have been volatile after a bout of avian flu, fell 7.3%. New and used car prices also dropped. By contrast, prices for gas and clothing both jumped.

Excluding volatile food and energy costs, so-called core prices rose 0.3% from March to April after three straight months of 0.4% increases. Measured with a year earlier, core prices increased 3.6% in April, down from 3.8% in March. The Fed closely tracks core prices, which tend to provide a better read of where inflation is headed.

In a statement Wednesday, Biden acknowledged that “prices are still too high.” But he said his policies will reduce prescription drug prices and encourage home construction to help ease housing costs. He also called on food store chains to lower grocery prices for consumers.

In a trend that has been frustrating for the inflation fighters at the Fed, apartment rental prices remained stubbornly high in April, climbing 0.4% from March. Average apartment rents are 5.4% higher than they were a year earlier. Rental and other housing costs accounted for two-thirds of the year-over-year increase in core prices.