Sorry, Amazon (AMZN) - Get Report .

As it prepares to raise its membership fees, Costco (COST) - Get Report reported a strong quarter and results for the first half of the year.

Costco generated net sales of $28.22 billion in its third fiscal quarter ending May 7, up 8% year-over-year. Earnings of $1.59 a share exceeded analysts' expected $1.31 a share, according to FactSet. During the six months ending May 7, net sales of $84.8 billion topped those during the same period in 2016 by 5.6%, and half-year diluted earnings of $3.99 a share represented a 12% increase year-over-year.

Costco shares rose 1.6% to $177.52 in early trading Friday.

"We're encouraged Costco delivered a strong quarter, including impressive traffic momentum in the U.S. and better than expected margins given a smaller headwind from fewer MVM days [coupons] and a benefit from the Visa credit card," wrote Cowen analyst Oliver Chen.

The results are the last ones before Costco's membership fees get hiked on June 3. About 35 million customers will pay more for their Costco membership: Goldstar membership is rising $5 to $60 per year, while Executive membership is rising $10 to $120. This follows a 10% hike in Taiwan, Korea, Japan, Mexico and the U.K. last fall.

Nomura analyst Jessica Schoen Mace predicted that the membership hike will take two years to impact Costco's bottom line, but she expects a benefit of about 30 cents a share in 2018. Morgan Stanley's Simeon Gutman predicted a 40 cents a share increase. Both Gutman and Cowen's Oliver Chen warned that the bulk of the fee increase will probably be reinvested in the company through lowered prices.

Updated with analyst comments.

Read More Trending Articles: