A Costco store in Richmond, Calif., March 6, 2014.

Costco Wholesale reported a 6 percent rise in June same-store sales that beat analysts' estimates, helped by higher fuel prices.

Excluding the impact of foreign exchange rates and gasoline prices, same-store sales rose 6 percent for the five-week period ended July 6.