(Reuters) - Shares in Costco COST.O fell 6 percent on Friday after the retailer reported a decline in quarterly gross margins and underlined the growing competition in the industry by launching new grocery delivery services.

The membership-based chain on Thursday reported a quarterly profit which scraped past estimates and said it had rolled out two grocery delivery services this week, a new step in its efforts to fight growing competition from Amazon.com AMZN.O and Wal-Mart Stores Inc WMT.N.

Chief Financial Officer Richard Galanti said in the company’s post-results call that the retailer had started offering two-day delivery of dry groceries as well as a same-day delivery service for groceries including fresh foods.

The two-day delivery would be free for online orders over $75 across the United States, while the same-day service - offered through its partner Instacart - is available at 376 U.S. stores.

BMO Capital Markets analyst Kelly Bania said the new offerings were a huge positive for Costco given the perception that it has been slow with its pace of digital transformation.

“(But) we also see risk these initiatives will weigh on margins over time and may be viewed as defensive,” she said.

Shares in Walmart and Kroger KR.N, the leading U.S. grocery retailers, were also down around 1 percent.

Groceries, while a low-margin business, bring more customers into stores, and major players including Wal-Mart and Target Corp TGT.N have poured millions into the area as they look to boost store traffic as well as online sales.

Competition has further tightened since Amazon bought Whole Foods and reduced prices at the upmarket grocer in August, a move which has hit Wal-Mart and Kroger hardest in terms of lost customers.

Galanti said Whole Foods’ price cuts had not impacted Costco and that it had not reduced its in-store prices in response to the deal.

“(Costco’s) new online delivery initiatives improve its competitive offering and could drive increased engagement with millennials,” Jefferies analyst Daniel Binder wrote in a note.

The retailer said it was lowering online prices and adding more high-end and well-known brands such as GE appliances and Spyder skiing apparel to its ecommerce site.

“Costco made e-commerce a core part of its earnings call for the first time in memory,” Susquehanna analyst Bill Dreher said. “We believe this shows a new focus on a key engine of growth.”