Analysts were looking for a 5.7 percent increase in the figure, according to a Thomson Reuters poll.
Sales at stores open at least a year is a key gauge of a retailer's health because it excludes results from locations recently opened or closed.
The wholesale club operator said Thursday that sales at stores in the U.S. open at least a year also climbed 5 percent for the four weeks ended Aug. 3. Internationally, the metric increased 6 percent.
Excluding the impact of lower gas prices and foreign currency fluctuations, sales at stores open at least a year climbed 6 percent in July. The U.S. had 5 percent growth while abroad reported a 7 percent rise.
Costco's total revenue for the month rose 9 percent to $8.55 billion.
For the year to date, the Issaquah, Washington company said sales at stores open at least a year increased 4 percent. The figure climbed 5 percent in the U.S. and 3 percent overseas.
Stripping out the impact of lower gas prices and foreign currency fluctuations, sales at stores open at least a year rose 6 percent. In the U.S. the metric climbed 5 percent. It increased 7 percent internationally.
Total revenue for the year to date rose 7 percent to $101.43 billion.
Costco Wholesale Corp. currently runs 660 warehouses, including 466 in the U.S. and Puerto Rico, 88 in Canada, 33 in Mexico, 25 in the U.K., 20 in Japan, 11 in Korea, 10 in Taiwan, six in Australia and one in Spain. The company plans to open up to an additional three new warehouses before its fiscal year ends on Aug. 31.