A Costco truck makes a delivery to a Costco store in Carlsbad, Calif., May 8. (Mike Blake/Reuters)

Costco Wholesale, which has long thrived on offering free samples, is giving its customers fewer reasons to come into its stores.

The company announced Thursday that it is rolling out two grocery delivery services that will bring fresh produce, as well as packaged goods and other items, straight to customers’ doorsteps. The move brings the membership-based chain face-to-face with some of its largest competitors, including Amazon.com, which recently completed its $13.6 billion purchase of Whole Foods Market, and Walmart, the country’s largest grocer. (Jeffrey P. Bezos, the founder and chief executive of Amazon, owns The Washington Post.)

But some analysts worried that Costco — which has been successful at getting people to make impulse purchases at stores — may lose its edge if fewer shoppers are roaming its aisles. Shares of the company’s stock tumbled 6 percent Friday following the announcement.

“The concern generally has been: If they are successful at delivery, does that take away business from the club?” said Scott Mushkin, an analyst for Wolfe Research. “The magic of Costco has always been its merchandising acumen: You go in to pick up Tide or toilet paper, and you walk out with Henckels knives.”

Some of those opportunities, he said, may be lost if customers are placing online orders instead of browsing in-store. And since there tends to be overlap between customers who use both Amazon Prime, which costs $99 a year, and Costco, where annual membership starts at $60, there is a risk of shoppers dropping one in favor of the other.

But, he added, those concerns could be overblown.

“Investors have become worrywarts when it comes to Costco,” he said. “But look at their numbers: great traffic, huge sales growth. These are big numbers for a big company.”

Costco announced Thursday that sales had grown 16 percent, to $41.4 billion, in the most recent quarter, up from $35.7 billion a year earlier. Same-store sales, a measure of sales in stores open more than a year, rose 5.7 percent, while profit was up 18 percent.

The company’s new programs include Costco Grocery, which offers two-day delivery on nonperishable foods, as well as an extended partnership with Instacart, a service that offers same-day groceries. Delivery is free on Costco Grocery orders of over $75.

“We feel good that we’ve got a few delivery options for our members that frankly are better than the ones they [have] with anybody else,” Richard Galanti, Costco’s chief financial officer, said in a Thursday call with investors.

Some in the retail industry said the delivery service was a natural next step for Costco, which is particularly popular among time-strapped middle-class families.

“This is about Costco understanding its customer,” said Matt Sargent, senior vice president for retail at research and consulting firm Magid. “If delivery works, it could help Costco reach a whole new customer. Not everybody wants to spend three hours of their Saturday shopping at Costco.”

Read more:

‘A new extreme’ for the sharing economy: Shoe rentals

The era of holiday deals is dead, and so is Black Friday

Amazon promised to make Whole Foods cheaper. Let’s see how that’s going.

Walmart wants to send people into your house to stock the fridge — even when you’re not home