(Reuters) - Costco Wholesale Corp's COST.O quarterly sales barely beat analysts' estimates on Thursday as growth in online business decelerated to its slowest in the year amid intense competition, while gross margins fell on rising costs and higher investments.

FILE PHOTO: A Costco truck makes a delivery to a Costco store in Carlsbad, California, U.S., May 8, 2017. REUTERS/Mike Blake/File Photo/File Photo

The warehouse club retailer’s shares fell as much as 3 percent after the bell, with the company saying it is reviewing its internal control over financial reporting.

The company’s gross margin fell 35 basis points to 10.92 percent in the fourth quarter on higher gas prices and investments.

Costco has been spending heavily on its online business and delivery operations and offering same-day and two-day grocery delivery with Instacart.

“We’re not only investing in price, we’re investing in infrastructure,” Chief Financial Officer Richard Galanti said on a conference call with analysts, adding that the retailer would be “doubling down” its spending on IT and fulfillment centers.

Despite this, comparable online sales in the quarter grew just 26.2 percent, its slowest in a year as the company faces stiff competition from bigger rival Amazon.com Inc AMZN.O, which entered the grocery business with the acquisition of Whole Foods last year.

The retailer, which has been lowering prices, said the company continues to earn more from credit card transitions and hike in membership fee as well as benefiting from tax cuts.

Adjusted same-store sales rose 7.2 percent, beating estimates of a 6.4 percent rise.

Net income attributable to Costco rose to $1.04 billion, or $2.36 per share, in the fourth quarter ended Sept. 2.

Net sales rose 5 percent to $44.41 billion. Analysts on average expected the company to post a profit of $2.36 per share on revenue of $44.27 billion, according to Thomson Reuters I/B/E/S.

Shares of the company, which have risen 25 percent this year, was down 2.9 percent at $226.50 in after-market trading.