US retail giant Walmart raised its profit outlook on Thursday, as stubbornly high prices and customer flight to value saw it grab market share in grocery and general merchandise.

For its second quarter, the retailer posted profits of $7.9bn (£6.19bn), up 53% year on year, having recovered from a build-up of excess stock due in part to unfolding pandemic supply chain issues.

Revenues for the period jumped 5.7% to $161.6bn (£127.72bn).

The retailer noted that while inflation has retreated from the highs seen in the US a year ago, consumers had shifted behaviours and were still more value-conscious compared with pre-pandemic levels.

US consumers are preparing more meals at home, which helped Walmart snap up grocery market share, but also drove sales of kitchen tools such as hand blenders and mixers.

Own-brand items across household staples also performed better than branded items, as customers searched for value.

Walmart chief executive Doug McMillon told analysts: “Jobs, wages and pockets of disinflation are helping our customers, but rising energy prices, resuming student loan payments, higher borrowing costs and tightening lending standards, and a drawdown in excess savings, mean that household budgets are still under pressure.”

Chief financial officer John Rainey noted that customers were “stretching their dollars further” and were “buying more necessities and focusing on lower-priced items and brands”.