A drop in online sales and rising costs have helped to push Amazon to its first quarterly loss since 2015.

Online sales at the e-commerce giant slipped 3% in the first three months of the year, as the boom to its business from the pandemic starts to fade, the firm said on Thursday.

Meanwhile, Apple warned its sales could be hit by up to $8bn (£6.4bn) following disruptions from lockdowns in China.

Both firms face supply chain issues and the impact of the war in Ukraine.

Growth in other parts of Amazon’s business, including cloud computing and advertising, remained strong.

Overall, the company reported a loss of $3.8bn, much of which was driven by a hit from its investment in electric carmaker Rivian.

It forecast sales growth of as little as 3% in the coming months – a marked slowdown from the double digit growth it has enjoyed in recent years, even before the pandemic.

“The pandemic and subsequent war in Ukraine have brought unusual growth and challenges,” Amazon chief executive Andy Jassy said.

He added that the company was also facing increased costs, with “ongoing inflationary and supply chain pressures”.

The firm’s overall sales continued to rise, up 7% year-on-year to $116.4bn, powered by Amazon Web Services (AWS) – the company’s cloud-computing division and reliable profit driver.

AWS revenues were up 37% year-on-year, while advertising revenue was also strong, rising 23%.

But elsewhere growth showed marked slowdown – especially in its international business, where sales sank 6%.

Expenses are also rising rapidly. Inflation added $2bn in expense in the quarter, while costs more within the firm’s control also hurt, executives said.

The company has increased wages to attract staff in the face of labour shortages and is also facing a widening unionising drive in the US.

Meanwhile, higher fuel prices have made delivery costs more expensive for the online retailer.

It comes after Amazon said it was raising the price of its Prime service, which gives subscribers access to benefits like faster shipping, for US customers, citing increased wage and shipping costs.

Shares in the firm sank more than 10% in after-hours trade. And concerns spread to other online retailers, adding to the fears in US markets, which have headed down in recent weeks.

Strong results from Apple initially appeared to help relieve some of those worries.

The iPhone maker said sales rose 9% year-on-year, to $97.3bn, and profits climbed more than 10% to $25bn.

But executives struck a less optimistic tone in a call with analysts to discuss the results, describing success despite a “challenging macroeconomic environment”.

The company warned of a $4bn to $8bn hit to its sales in the three months to the end of June because of disruptions to global supply chains.

“We are not immune to these challenges but we have great confidence in our teams, in our products and service and in our strategy,” chief executive Tim Cook said.

Covid-related shutdowns in China and chip shortages are limiting the firm’s ability to meet demand for its products, Mr Cook said. He added that he was more concerned about those supply issues than that buyers will cut spending.

Chinese authorities are trying to contain a coronavirus outbreak in Beijing after locking down the financial and manufacturing hub of Shanghai.

Mr Cook said Apple’s problems in China were “primarily centred” in Shanghai, but noted that infections in the city, which was locked down because of a surge in infections, have now fallen.

He added: “Almost all of [our] affected final assembly factories have now restarted.”

Companies making Apple products have been affected by rising Covid cases in China, with several temporarily suspending production in recent weeks due to lockdown restrictions.

Technology company Pegatron, which is a major producer of the iPhone, temporarily suspended production at two of its Chinese factories earlier this month.

It said it halted operations at its factories in Shanghai and nearby Kunshan “in response to Covid-19 prevention requirements from local government”.

On Friday, the firm declined to say if it has since reopened the sites.

Earlier this week, Facebook owner Meta reported its slowest revenue growth in a decade, as businesses pull back on advertising amid rising costs and economic uncertainty.

Last week, Netflix also warned its revenue growth had slowed considerably after it lost subscribers due to stiff competition from rivals and the rising cost of living.