Americans bought less stuff and spent more on services like travel and recreation coming out of the pandemic, catching major retailers off guard at the start of this year. Now with the threat of a recession on the horizon, retailers are still figuring out how to get rid of all their excess inventory.
Based on Walmart’s most recent earnings report, it seems that America’s biggest retailer is doing relatively well despite those uneasy conditions. And its performance might be cause for renewed hope in the U.S. economy.
On Tuesday, Walmart reported that its revenue rose 8.4% in the second quarter despite fears that the pandemic and inflation-related shifts in consumer behavior would hurt sales.
“We’re pleased to see more customers choosing Walmart during this inflationary period, and we’re working hard to support them as they prioritize their spending,” said Walmart CEO Doug McMillon in a statement. He noted that the company has successfully reduced its inventory levels recently via markdowns, leading to a smaller profit margin despite sales growth.
McMillon further explained the increased sales during an earnings call on Tuesday. “The reversion back to pre-pandemic norms has been sharp and difficult to predict,” he said. “These trends have been exacerbated by inflationary pressure on the consumer that many of us have not experienced in our lifetime.”
Those complications, he said, resulted in excess inventory that peaked during the first quarter.
Earlier this year, Walmart, Target, and Amazon all saw their shares drop after first-quarter profits failed to meet investor expectations, with supply-chain and inventory issues cited as primary causes.
Tuesday’s earnings report from Walmart, however, exceeded expectations. In a research note published Tuesday, Bank of America stated that Walmart’s latest quarterly earnings per share of $1.77 is significantly higher than its forecast of $1.50.
Still, the company expects adjusted earnings per share to decline 9% to 11% for the full year.
On CNBC’s Squawk on the Street on Monday, McMillon said that a major part of Walmart’s second-quarter sales strength came from spending by wealthier families. “People are really price-focused now, regardless of income level,” he said. “And the longer this lasts, the more that’s going to be the case.”
Last week the Bureau of Labor Statistics said there was no net price growth in July, with inflation declining to 8.5% year over year after reaching a high of 9.1% in June.
Tuesday’s report shows that while inflation is influencing consumer spending, it’s not stopping spending altogether. In its own report on the company, Bank of America noted particular softness in “discretionary” purchases, meaning that consumers are currently focused more on essential goods like food than electronics and clothes.
Last month, the Bureau of Economic Analysis revealed that personal consumer expenditures (PCE), had increased 1.1% month over month in June, up from 0.3% the previous month and evidence that spending is largely holding steady. That’s especially important for the U.S. economy’s overall health, since consumer spending makes up nearly two-thirds of U.S. GDP.
“We made good progress throughout the quarter operationally to improve costs in our supply chain, and that work is ongoing,” wrote McMillon in the report. “We continue to build on our strategy to expand our digital businesses, including the continued strength we see in our international markets.”
It’s possible that Walmart’s second-quarter successes reflect a broader improvement by the U.S. economy. It could, however, just be unique to Walmart. In its report, Bank of America notes that the company has outperformed the S&P 500 over the last five recessions, and that food retailers—Walmart has a large grocery division— historically perform well during periods of high inflation.
Sign up for the Fortune Features email list so you don’t miss our biggest features, exclusive interviews, and investigations.