Costco Wholesale Corp.'s (COST) fiscal fourth-quarter earnings fell 6% as the nation's biggest warehouse club continued struggling with weak sales of nonfood products, but profit did beat expectations for the first time this year and recent sales showed improvement.

Costco, which sells items in bulk to its paid members, continued showing strong membership trends and its overall merchandise margin, a measure of profitability, rose from a year ago.

The retailer, which has been battling consumer-spending cutbacks amid the weak global economy, said profit for the quarter ended Aug. 30, was $374 million, or $0.85 a share, down from $398 million, or $0.90 a share, a year earlier. Net sales were $21.89 billion, down 3%.

Analysts surveyed by Thomson Reuters had projected earnings of 77 cents and revenue of $22.34 billion.

Comparable store sales dropped 5% in the fourth quarter. Excluding the effects of lower gas prices and a stronger dollar during the period, same-store sales rose 1%.

Demonstrating improvement in September, same store sales for the period were up 1%, when analysts expected a 0.6% drop. Comparable store sales rose 4% last month when the effects of gas and the stronger dollar are backed out.

Costco shares are up 3.9% to $60.21.

"It feels like they are hitting a turning point," said Joe Feldman, retail analyst at Telsey Advisory Group. "This is the second month in a row we've seen decent sales."

Costo demonstrated it can still draw customers in a weak environment, with membership fees raising $490 million, up 3.4%, during the quarter. Membership fees represent 75% to 80% of operating profit and bode well for upcoming sales since customers sign on for a period of time.

Even though sales fell from a year ago, merchandise gross margin was up 10.9% from 10.3%.

-By Karen Talley, Dow Jones Newswires; 212-416-2196; karen.talley@dowjones.com