JD.com posted its first quarterly loss in nearly four years as the food-delivery subsidy war in China continued to take a toll on the e-commerce giant.

The hit to its bottom line underscored the intense pressure the Beijing-based company has faced as it vies for market share in a competitive industry. JD.com has been locked in an intense food-delivery price battle with Meituan and Alibaba Group since entering the market in early 2025, fueling concerns about thin margins and near-term profitability.

Korea Warns That Prolonged Middle East Conflict Could Hurt Chip Industry

Anthropic Says It Will Fight New Pentagon Move as CEO Apologizes for Leaked Memo

How Robinhood’s New $695-a-Year Credit Card Stacks Up in a Crowded Market

The Wildest Frat Party on Campus? Prediction Markets

Six Flags to Sell 7 of Its Amusement Parks

While e-commerce remains its primary business, JD.com has moved quickly to gain a foothold in the food-delivery sector, using heavy subsidies to lure customers away from market leader Meituan and No. 2 player Ele.me. The company aims to grow its share of the food-delivery market to 30% in 2026 from the more than 15% it has gained, it said last month.

The online retailer on Thursday swung to a fourth-quarter net loss of 2.71 billion yuan, equivalent to $392.9 million, its first since the first quarter of 2022. That compared with net profit of 9.85 billion yuan a year earlier. Analysts had expected a smaller loss of 203.6 million yuan, according to a FactSet consensus estimate.

Excluding share-based compensation and fair-value changes of long-term investments, among other items, adjusted net profit was 1.08 billion yuan, a 90% drop from the previous year.

Revenue was better than expected, rising 1.5% to 352.28 billion yuan. The company approved an annual cash dividend of 50 cents a share, representing a roughly $1.4 billion payout to shareholders.

Retail sales, which account for more than four-fifths of total revenue, fell 1.7% in the three months ended December, while logistics sales increased 22%. The new business segment, which includes food delivery and overseas businesses, tripled its revenue.

Analysts say reduced government trade-in incentives have pushed JD.com to rely more on discounts to attract customers. China’s macroeconomic weakness and sluggish consumer sentiment have also pressured its core business. The concerns have weighed on the company’s Hong Kong-listed stock, which fell 18% last year and has declined an additional 13% so far this year.

Citi recently cut its net profit forecasts for JD.com this year and next by 7.9% and 1.9%, respectively. It maintained a buy rating on the company but lowered the target price on its American depositary receipts to $34.00 from $37.00.

However, HSBC analysts noted Beijing’s continued positive stance toward supporting consumption. The latest top policy meeting suggests “a widening of support for consumption beyond just goods, but also more support for services and providers,” they said in a research note.

Write to Tracy Qu at tracy.qu@wsj.com

Crypto Fans Have an Alternative to Savings Accounts. Banks Are Freaking Out.

AI-Generated Writing Is Everywhere, and It’s Still Easy to Spot—for Now

How War in Iran Is Colliding With Trump’s Economic Priorities

Federal Health Officials Attack Rare-Disease Drug, Say Company Lied

The Race to Seize on Lower Tariffs Has Businesses Rushing In Shipments