• Second-quarter expenses increased faster than revenue
  • Spending to continue in anticipation of holiday shopping

Amazon.com Inc. reported a steep jump in quarterly expenses and gave a disappointing profit outlook, blunting its momentum as the e-commerce giant prepares to enter the grocery store business by buying Whole Foods Market Inc.

The results and forecast show the world’s biggest online retailer is preparing for stepped up competition from rival Wal-Mart Stores Inc. and cloud-computing challengers Microsoft Corp. and Alphabet Inc.

Investors have put increasing faith in Chief Executive Officer Jeff Bezos to keep the company growing by entering new categories such as groceries and appliances and expanding abroad. Their confidence has sent the stock up 39 percent this year and was unfazed by the announcement that Amazon would spend $13.7 billion for Whole Foods, the company’s biggest-ever acquisition. But the support took a turn in extended trading after Thursday’s results were reported, with shares falling as much as 4.3 percent to $1,001.80.

Second-quarter expenses increased 28 percent to $37.3 billion. Sales gained 25 percent to $38 billion, the Seattle-based company said in a statement. Net income declined to $197 million, or 40 cents a share, from $857 million, or $1.78 a share, a year earlier. Analysts estimated profit of $1.42 a share on revenue of $37.2 billion, according to data compiled by Bloomberg.

“Spending is always a concern with Amazon, but investors eventually give Amazon a pass because Amazon invests in growth opportunities,” said Victor Anthony, an analyst at Aegis Capital Corp.

The company is expanding into India and Australia, speeding up delivery times to as little as…