Gas prices continue to benefit Costco Wholesale Corp., which reported strong July sales after the market closed on Wednesday. The company’s sales for the month were $16.85 billion, compared with $15.21 billion in the same period last year.

Analysts were impressed by the company’s performance.

Costco Wholesale Corp. COST, -0.95% shares fluctuated in premarket trading Thursday, and were last down 0.3%, after closing Wednesday’s session up 0.7% at $547.01.

In a statement, Costco said that this year’s four-week retail month had one fewer shopping day in the U.S. compared with last year, due to the timing of Independence Day. “This negatively impacted Total Company total and comparable sales by approximately two and one-half percent, and U.S. total and comparable sales by approximately three and one-half percent,” the retailer wrote.

“July sales remain strong,” wrote Truist Securities analyst Scot Ciccarelli, in a note released on Wednesday. “In an increasingly difficult economic environment, we believe Costco’s extremely competitive pricing will enable the company to continue to take market share as consumers seek out value.”

See Now: Costco discussing membership rate hikes after renewals hit 90%

Truist Securities raised its Costco price target to $571 from $543 and reiterated its buy rating.

“Higher gasoline prices likely contributed to both traffic and ticket growth, as higher fuel prices (+40% y/y) typically drive incremental traffic to discount fuel retailers such as Costco,” wrote Stifel analyst Mark Astrachan, in a note released on Thursday. “We continue to view Costco as a best-in-class retailer and a core holding for large-cap consumer investors.”

Gas prices also helped boost Costco’s June results.

Stifel raised its Costco price target to $565 from $515 and maintained its buy rating.

“While recession and slowing economy concerns remain plenty, COST for one continues to put up good results from a top line perspective, with another good month in the core business when adjusting for the timing of July 4th,” wrote D.A. Davidson analyst Michael Baker, in a note released on Wednesday.

See Now: Costco is not lifting the price of its $1.50 hot-dog deal. But inflation pressure did force a hike for this food item

“Costco comps continue to benefit from inflation, as do other retailers of basic products,” Baker added. “We believe share gains are being helped by higher gas prices, which are likely driving incremental traffic as consumers gravitate to the clubs to save money at the pump, and then do their shopping while there.”

However, Baker said this benefit is waning as gas price inflation is moderating. D.A. Davidson reiterated its neutral rating and $440 price target for Costco.

Costco shares have fallen 3.6% this year, compared with the S&P 500 index’s SPX, -0.12% decline of 12.8%.

Of 32 analysts surveyed by FactSet, 20 have overweight or buy ratings on Costco, while 12 have a hold rating.