Beginning last summer, Costco Wholesale (COST 0.17%) posted a series of humongous sales gains. Unsurprisingly, some skeptics wondered whether this sales surge was just a blip caused by the COVID-19 pandemic.

In recent months, Costco has proved the doubters wrong by continuing to post strong sales growth while going up against increasingly difficult year-over-year comparisons. The warehouse club giant did so yet again when it reported its July sales results last week.

Another excellent month

For the four-week period ending on Aug. 1, Costco's adjusted comp sales (excluding the impact of gasoline price inflation and currency fluctuations) rose 8% year over year. The company reported solid comp sales growth in all regions of the world, ranging from 8.5% in the U.S. to 5.5% in Canada.

Comparable e-commerce sales grew just 5.7% last month, compared to a 76.1% jump a year earlier. Instead, brick-and-mortar sales powered the bulk of Costco's growth. Indeed, consumers continue to flock to Costco's warehouses, even with COVID-19 case numbers rocketing higher in the U.S. (the company's top market by far). Comparable traffic increased 6.9% globally and 5.8% in the U.S. during July.

Costco's high-single-digit comp sales growth was particularly impressive because the retailer faced an extremely tough year-over-year comparison. Adjusted comp sales surged 15.8% in the prior-year period.

The entrance to a Costco warehouse.

Image source: Costco Wholesale.

Including the benefit from soaring gasoline prices and the weakening dollar, Costco's comparable sales grew 13.8% last month. And total sales rose 16.6% to $15.2 billion.

Non-food and ancillary categories continue to lead

During the peak of the pandemic, sales of food and related items surged at Costco as consumers chose to cook at home more often. As a result, comp sales growth in those categories has lagged the company average in recent months (while remaining positive).

However, Costco continues to post double-digit growth in sales of non-food merchandise. Home furnishings, sporting goods, jewelry, and hardware all performed especially well last month.

Meanwhile, sales continue to rocket higher in Costco's ancillary business lines. Ancillary comp sales jumped more than 40% year over year in July. Costco is selling even more gasoline than it did before the pandemic. It's also seeing strong recoveries at its food courts and optical departments.

Costco stock keeps hitting new highs

After briefly plunging below $320 earlier this year, Costco stock has rallied more than 40%, recently reaching a new all-time high above $440. The stock has more than doubled since the beginning of 2019.

COST Chart

Costco Wholesale stock performance, data by YCharts.

Costco certainly deserves the love it is getting from investors. Adjusted comp sales growth topped out around 17% last fall. Given that Costco just reported an 8% comp sales gain for July on top of a 15.8% increase a year earlier, the retail giant seems poised to continue posting solid sales growth for the foreseeable future.

That said, Costco stock now trades for a hefty 38 times forward earnings. Considering the company's deep moat and massive expansion potential, Costco is still a solid stock for long-term investors. However, in light of the stock's lofty valuation today, shareholders should expect slower share-price appreciation going forward.