Walmart Inc.  (WMT) is starting to see long-awaited sales growth in its U.K. division as Britons shift their shopping habits towards food purchases amid a slump in consumer confidence and surging inflation.

Overall supermarket sales growth in the 12 weeks ended on June 18 grew by 5%, the strongest increase since March 2012, according to Kantar Worldpanel's U.K. grocery store market share data released Tuesday, as warm weather spurred a food-buying frenzy.

"The market's robust performance this period is partly down to particularly weak sales growth last year and a continuing increase in like-for-like grocery inflation, which is now running at 3.2%," Kantar Worldpanel's Head of Retail and Consumer Insight Fraser McKevitt said in a statement.

Sales at Wal-Mart Stores Inc.'s U.K. division, Asda plc., grew by 2.2% in the period, well ahead of the 0.9% recorded in the 12 weeks to May 21, Kantar data indicated. This is the highest growth for Asda since the beginning of 2017, although the retailer's market share in fell to 15.1% from 15.6% in the same time period last year.

Consumer confidence in the U.K. fell to the lowest levels since last year's Brexit referendum, according to data published by the polling group YouGov and the Centre for Economics and Business Research.

U.K. retail sales fell at the fastest pace in four years last month, according to data from the Office for National Statistics, with "increased retail prices across all sectors" a "significant factor in slowing growth."

The gloomy outlook has shoppers looking for steeper discounts, allowing Wm Morrisons plc (MRWSY)  to record the strongest sales performance of the 'Big Four' grocers - Tesco plc (TSCDY) , J Sainsbury plc (JSAIY) and Asda over the three month period in Britain's ongoing food price war. The retailer increased sales by 3.7%, posting growth for the seventh consecutive period despite market share slipping back by 0.2 percentage points to 10.6%.

Morrison shares were up 0.08% in London at 8:58 BST, extending a three month gain of 1.86%.

Tesco saw an increase in sales of 3.5% and Sainsbury's was up 3.1%. However, the standout performers were low-cost competitors Aldi and Lidl, which saw sales up 18.7% and 18.8% respectively.

Tesco shares were marked 1.11% higher, to change hands at 168.65 pence. Sainsbury's shares were down 0.31% to 254.20 pence, extending a 4.93% loss for the stock over the past three months, compared with a 5.76% loss for the FTSE 350 Food and Drug Retailers Index. 

Amazon.com Inc's (AMZN) $13.7 billion deal to buy Whole Foods Markets (WFM) has brought renewed focus to online shopping, which now accounts for 7.6% of grocery sales and is growing by more than 10% each year, according to Kantar Worldpanel data.

The retail giant will be keen to increase its share of the grocery sector, where it currently holds less than 1% of online sales, Kantar said, its online rival Ocado Group plc OCDDY now has an overall market share of 1.3%, with sales up 10.7% compared with this time last year.

Visit here for the latest business headlines.