Walmart reported strong Q4 financial results, defying the spread of the Omicron variant of COVID-19 and the rise of inflation.

On Thursday morning, the retail giant beat analyst estimates as Americans returned to brick-and-mortar stores.

Net sales topped $150 billion in Q4, with U.S. net sales exceeding $105 billion. Comp sales grew 5.6% as the company gained market share in its food business.

Sam’s Club comp sales rose 10.4%, 21.2% on a two-year stack, while membership income jumped 9.1%.

“Retail giants saw very strong numbers relative to other retailers. Looking at visits compared to the same months in 2019 and 2021, Walmart saw visits down 2.5% in November, up 0.3% in December and down 3.1% in January,” says Placer.ai, which tallies traffic in the nation’s retailers. “This outpaced the wider retail sector with far more limited declines and an actual visit gain in December.

“Though the retailer lost out on Thanksgiving traffic completely, and January visits were heavily impacted by Omicron, the overall effect was fairly limited. This speaks to Walmart’s ability to offset the unique challenges faced in recent months with a focus on an extended holiday season [visits were up 5.3% in October] and its omnichannel strength.”

Meanwhile, the nation’s retailers have benefited from a couple of additional factors. One of them is the strong labor market. Early in the month, the Bureau of Labor Statistics (BLS) announced that U.S. businesses added 467,000 jobs in January, well above the 150,000 markets had expected. Unemployment increased to 4% while the December jobs report was revised upward to 510,000.

There is also the merging of online and offline sales, which gives conventional retailers an edge when ordering the merchandise online and having it picked up in local stores. Walmart’s e-commerce sales have increased 70% over the last two years.

And there’s Walmart’s large scale, scope and state-of-the-art logistics, which gives it a competitive advantage over smaller retailers.

Doug McMillon, president and CEO, hailed the company’s strong Q4 results.

“We had another strong quarter to finish off a strong year. We have momentum in our business in all three segments,” he said. “We’re being aggressive with our plans and executing on the strategy. It’s exciting to see how the teams are simultaneously navigating today’s challenges and reshaping our business.”

Wall Street sent the company’s shares sharply higher in the opening on a down day.

Investors should be cautious about chasing the stocks of major retailers at this point as inflation and Fed interest-rate hikes could catch up with consumers, tapering prospects for further gains.