Food prices soared at their fastest rate in 27 years in August, compared with July, official figures show.
But falling petrol prices meant the overall inflation rate slowed slightly in the year to August, the Office for National Statistics (ONS) said.
Prices are rising faster than wages, putting pressure on household budgets.
The Bank of England has said inflation could top 13% this year and is expected to keep raising interest rates to try and control it.
In general, prices rose at nearly their fastest rate in 40 years in August, driven by the pace of food price rises.
In August food and soft drink, prices rose by 1.5% compared with July. This was the largest July to August rise since 1995.
The war has disrupted supplies from the two countries, which are major exporters of goods such as sunflower oil, wheat, and fertilizer.
However, inflation – a measure of price rises – dipped to 9.9% in the 12 months to August, from 10.1% in July, as petrol and diesel prices fell, the ONS said.
Petrol prices fell by 14.3p per liter between July and August, while diesel prices also dipped.