Consumer prices in Britain rose 7.9 percent in June from a year ago, the Office for National Statistics said on Wednesday, the slowest pace of inflation in more than a year.

The slowdown, which was greater than economists had expected, will bring some relief to the government following months of inflation repeatedly turning out higher than forecast. The annual rate of price growth slowed from 8.7 percent in May. The decline was driven by a large drop in the price of motor fuels.

Food prices rose 17.3 percent in June from the year before. While that’s still high, food inflation has fallen from a peak of 19 percent in April. The easing of price increases here also helped pull down the overall rate of inflation.

Core inflation, which excludes food and energy prices, was 6.9 percent in June, down from 7.1 percent the previous month.

Headline inflation rates have declined, but policymakers are closely watching other measures of price pressure that signal how deeply inflation has become embedded in the British economy. Price rises in the services sector, and a pickup in wage growth, are signals of persistent inflation and among the reasons the central bank has raised interest rates to the highest level since 2008.

In June, some of these price pressures eased: Inflation in the services sector slowed slightly to 7.2 percent, and core inflation declined for the first time since January.

Wednesday’s data was “a rare and welcome downside surprise,” Andrew Goodwin, an economist at Oxford Economics, said. But he cautioned that some of the reasons for the slowdown came from price categories that can be volatile, including furniture prices.

“I don’t think this release is a game changer,” Mr. Goodwin added. “Fundamentally, wage growth and services inflation are too high.”

High prices have eaten away at household budgets for a year and a half. In January, the government pledged to halve the inflation rate by the end of this year, which would mean a fall to 5.2 percent.

Inflation is expected to slow meaningfully in the second half of this year, when the impact of last year’s surge in energy prices will no longer influence the annual calculations, and consumers start seeing the benefits of falling production costs for manufacturers.

But the pace of this slowdown has become another source of uncertainty. In recent months, inflation readings had been surprisingly high, and the Bank of England has stepped up its warnings that inflation is stickier than officials expected.

Achieving the government’s pledge will not resolve Britain’s inflation problem. The central bank has a mandate to ensure price stability, which is measured as 2 percent inflation.

Like its neighbors in Europe, inflation in Britain was pushed up by soaring energy prices last year. But as wholesale prices have dropped this year, the benefit has been slow to reach British households, in part because energy price caps are set quarterly by a government regulator.

This partially explains Britain’s relatively high inflation rate — which is higher than in Western Europe and double the rate in the United States — but there are other reasons that inflationary pressures in Britain are strong.

Britain still has more people out of the work force than before the pandemic, unemployment is low and job vacancies are high. Employers are pushing up wages to attract and retain workers. Even though most of these pay increases are not keeping up with inflation, wage growth risks becoming a stubborn source of higher prices as companies pass on higher labor costs.

Pay in the private sector rose 7.1 percent in the three months through May compared with a year earlier, a record high outside of the pandemic when furlough distorted the data.

The Bank of England raised its interest rate a 13th time last month, to 5 percent, from 0.1 percent in late 2021. But investors expect rates to go higher when policymakers meet again in early August.

“Inflation is unacceptably high,” Andrew Bailey, the bank’s governor, said last week. He added that the current pace of price and wage increases were not consistent with meeting the bank’s 2 percent inflation target.

Mr. Bailey and the government have said that the pain of higher interest rates is less than the pain of persistently high inflation, but each increase in interest rates comes as another blow to mortgage holders who need to renew the terms on their fixed-rate loans.

Many mortgage rates will be jumping above 6 percent, from below 2 percent. By the end of this year, about three million mortgage holders will experience an increase of up to £500 a month on their repayments, the Bank of England estimates.