Investors should buy Costco shares because it is one of the few retailers that can succeed versus e-commerce competition, according to Barclays, which upgraded the wholesale club chain to overweight from equal weight.
"Given Costco's high-quality merchandise in food, low prices, and the frequency of purchase for these items, we believe that the company's customers will remain loyal and believe Costco's price positioning and quality in food insulates it from AMZN," analyst Karen Short wrote in a note to clients Thursday.
Short raised her price target for Costco to $185 from $170, representing 9 percent upside from Thursday's close.
The analyst cited how food and groceries represent 57 percent of Costco's sales. The firm surveyed 600 consumers and found more than 80 percent of the retailer's customers "specifically" shop at Costco for its food and grocery offerings.
"This tells us analytically (as opposed to intuitively) that COST is very protected from AMZN," she wrote.
Short also predicts the retailer's sales results will improve going forward due to easier comparisons, better profits from its 2016 Visa credit card deal and more store investments from its coming membership fee increase.
Costco announced it will raise its annual membership fee by $5 effective June 1.
"While COST trades at premium vs. other names in our space, we think this is deserved given the 'scarcity value' of retailers with sustainable and defensible business models," she wrote.
— CNBC's Michael Bloom contributed to this story.