Plagued by higher costs and slower growth, the company sees “challenges” ahead.

Amazon posted its first quarterly loss in seven years, according to reporting in The Wall Street Journal. The disappointing results reflect broad economic trends related to a slump in online shopping, higher costs from inflation and supply-chain woes and market jitters over electric vehicle startups.

Revenue for the tech giant rose by about 7% for the January-to-March period, the slowest pace in about two decades as consumers returned to prepandemic habits and spent more money in person at stores. It lost $3.8 billion in the quarter, compared with a profit of $8.1 billion a year ago, when a surge in online orders due to the pandemic lifted Amazon’s prospects.

The performance for Amazon’s sprawling collection of businesses reflects several currents now roiling the tech industry. The amount of products Amazon sold during the quarter was essentially flat from a year ago, and the company reported a 3% year-over-year drop in its online stores segment, which include product sales primarily on its flagship site and digital media content. That’s the largest drop since the metric was first disclosed in 2016.

Revenue from ads and entertainment subscriptions have slowed

Meanwhile, revenue growth has slowed in its subscriptions business—which includes its Prime entertainment offerings—and in digital ads, where its rapid expansion in recent years has challenged industry giants Google and Meta’s Facebook. Advertising services revenue grew 25% in the latest quarter, excluding currency impact—still fast but well below the 33% clip in the fourth quarter of 2021 and 76% in the first three months of last year.

Amazon signaled more uncertainty is on the way. It said it expects its operating income for the current quarter to be between a loss of $1 billion and profit of $3 billion. It posted $7.7 billion in operating income during the second quarter of 2021. The company’s shares were down roughly 10% in after-hours trading, reaching the lowest point since June 2020.

“The pandemic and subsequent war in Ukraine have brought unusual growth and challenges,” Chief Executive Andy Jassy said in a statement. Mr. Jassy said Amazon would improve by working through pressures from inflation and its supply chain.

Also read: AWS plans to expand their market lead.