Costco shares may have peaked after the stock's strong performance this year, according to Wells Fargo Securities.

The firm lowered its rating to market perform from outperform for Costco shares, citing the retailer's high valuation.

"Costco has delivered stellar performance over the last year, as we believe robust top-line growth has driven the stock sharply higher and valuation to its 20-year peak," analyst Edward Kelly said in a note to clients Friday. "While Costco remains one of the highest quality companies within consumer and near-term results should be positive, we can't help but think this may be as good as it gets."

Costco shares declined by 2.4 percent Friday. Its stock is up 30 percent this year through Thursday versus the S&P 500's 9 percent gain.

Kelly reaffirmed his $235 price target for Costco shares, representing 3 percent downside to Thursday's close.

The analyst said Costco's same-store sales growth rate is more than 7 percent on average this year versus 5.7 percent in 2017 and 5.1 percent from 2011 to 2016.

"While the consumer outlook remains positive, we struggle to find the next catalyst for above average performance," he said. The retailer's share price move over the past year "has left it priced for perfection and diminished the risk/reward, in our view."

Costco did not immediately respond to a request for comment.