Costco Wholesale (COST -0.32%) didn't escape from the COVID-19 pandemic completely unscathed. The warehouse-club chain's comparable sales declined in April for the first time in over a decade, due to the impact of stay-at-home orders, which decimated traffic to Costco's warehouses.

However, the pressure didn't last for long. Sales returned to growth in May as shoppers started to venture out to stores in greater numbers. And last week, Costco reported that sales trends accelerated again in June, with the company logging a rare double-digit comp-sales gain.

A quick dip and a quick recovery

The COVID-19 pandemic hit most of Costco's major markets (especially the U.S.) in March. Initially, the pandemic was good for business, as it led to a surge in "stock-up" trips to buy essentials. Costco's comparable sales (adjusted to exclude the impact of foreign currency fluctuations and changes in gasoline prices) jumped 12.3% year over year in March, with strong growth across all of its major markets.

On the flip side, once customers' pantries were full and stay-at-home orders were in effect in most of Costco's markets, sales slowed. In April, adjusted comparable sales slipped 0.5%, pulled down by sharp sales declines in ancillary business lines like gasoline, travel, hearing aids, optical and photo departments, and the company's popular food courts. Results were particularly weak in Canada.

Sales snapped back quickly, though. Adjusted comparable sales surged 9.7% year over year in May, including 17.9% growth outside the U.S. and Canada.

The entrance to a Costco warehouse

Image source: Costco Wholesale.

Further improvement in June

Costco continued gaining momentum last month. During the five-week period that ended on July 5, adjusted comparable sales skyrocketed 14.4% year over year. As a result, total sales increased 11.1% to $16.18 billion, despite significant headwinds from lower gas prices and the strong dollar.

In fact, Costco posted double-digit adjusted comp sales gains in all three of its regions last month, with a 13.6% increase in the U.S., 12.2% growth in Canada, and a stunning 22.1% surge for the rest of the world. Internationally, it achieved the strongest growth in the U.K., Japan, and Australia. E-commerce sales contributed to the stellar growth, rising more than 85% year over year for the third consecutive month.

Costco's stellar comp-sales growth came despite a "high-teens" comp-sales decline in ancillary business lines. For example, gasoline demand remains depressed, food courts are still offering limited operations, and photo departments have seen sluggish sales.

By contrast, Costco logged "mid-teens" or stronger growth last month in each of its four core merchandise classifications -- food and sundries, fresh, hardlines, and softlines. With people eating at home more often, grocery sales continue to grow strongly. Meanwhile, Costco's hardlines and softlines categories are benefiting from demand for appliances, major electronics, hardware, and home furnishings as customers look to spruce up their homes during the pandemic.

Setting up for a strong end to fiscal 2020

With two months left in Costco's 2020 fiscal year, it looks like the company could report blowout results for the fourth quarter. In the third quarter, which ended on May 10, adjusted comparable sales increased 7.8%, as the retailer's weak April results offset its stellar growth in March. Pre-tax earnings rose 3.6% year over year to $1.16 billion, despite a $283 million pre-tax headwind from higher wages and sanitation costs associated with the pandemic.

Based on the consumer-staples giant's strong May and June results, it looks like Costco will post significantly higher sales growth in the fourth fiscal quarter than it did last quarter. That, in turn, should help the company leverage its fixed costs and overcome pandemic-related cost pressures, enabling faster earnings growth. Strong gasoline margins could also juice Costco's profits.

Obviously, 2020 will go down as a very unusual year for retailers. Some of the changes to consumer shopping patterns will prove temporary, while others may become permanent. Thanks to its relentless focus on providing real value to its members, Costco is one of the retailers best positioned to retain the market share it's gaining this year.