BEIJING, June 27 (Reuters) - Profits at China's industrial firms grew more slowly though still at a double-digit pace in May, highlighting a widening divide in an economy leaning on factory ‌output and overseas shipments to counter soft domestic demand.

Economic growth remains fragile, hobbled by a prolonged ‌property downturn and deep structural imbalances that continue to weigh on domestic activity. Meanwhile, companies seeking to escape intensifying competition at home ​face fresh uncertainty from the protracted Iran conflict.

Profit growth at the country's industrial firms in May was 21.1% from a year earlier, easing from 24.7% in April, data from the National Bureau of Statistics (NBS) showed on Saturday.

Profits for January-May climbed 18.8% over the corresponding period last year versus an 18.2% increase in the first four months.

"Upstream ‌sectors and the computer industry saw sharp ⁠rises, while downstream manufacturing remained under pressure, in line with the producer price index, suggesting that price improvement was the main driver of corporate profit growth," said Zhaopeng ⁠Xing, senior China strategist at ANZ.

Earnings trends have diverged sharply across sectors. Profits of manufacturers of computers, communication and electronic equipment soared 103.9% in January-May - accounting for 43.1% of the growth in profits of all industrial firms - buoyed ​by a ​global AI investment boom.

Profit from the non-ferrous metal ore ​mining and processing sector rose 93.9%.

By contrast, profits ‌at automakers dropped 19.8% despite robust exports, while furniture makers' profits plunged 58.4%.

Tianchen Xu, senior economist at the Economist Intelligence Unit, said the differentiation highlights the importance of a de-escalation of the Iran conflict.

"As shipping through the Strait of Hormuz resumes and international oil prices fall, we should see a gradual recovery in downstream profits."

The U.S. military attacked Iran on Friday in response to an Iranian drone strike on a cargo ship ‌in the Strait of Hormuz, with each country accusing the ​other of violating terms of a ceasefire agreed last week.

Analysts expect ​Chinese policymakers to step up targeted support ​to stabilise corporate profitability, particularly as consolidation accelerates in sectors grappling with overcapacity and ‌cut-throat competition.

China's central bank had instructed some commercial ​banks to increase their lending ​this month, people familiar with the matter said on Friday, the latest sign that demand for credit remains weak as the economy grapples with sluggish domestic consumption.

China's factory-gate inflation accelerated to nearly ​a four-year high in May, with cost ‌pressures squeezing corporate profit.

Industrial profit figures cover firms with annual revenues of at least 20 ​million yuan ($2.95 million) from their main operations.

($1 = 6.7783 Chinese yuan)

(Reporting by Qiaoyi Li, Ellen Zhang, ​Shuyan Wang and Ryan Woo; Editing by Jacqueline Wong)