Copper prices extended gains on Wednesday to hit their highest in two weeks ​on hopes that the Iran ⁠war is close to ending.

Benchmark three-month copper on the London Metal Exchange rose ‌0.2% to $12,365 a metric ton in official open-outcry trading after hitting $12,492.50, its highest since March 18.

That marked its fourth ​straight session of gains, but copper was still well below a record high of $14,527.50 hit on January 29. "The market ​wants to ​believe that we're getting closer to an end to this escalation, even though we still have economic clouds hanging over the markets, which are quite grey and ⁠could worsen," said Ole Hansen, head of commodity strategy at Saxo Bank in Copenhagen. Copper joined stocks and other financial markets in rallying after President Donald Trump said the end of the war on Iran could be near.

The most-active copper contract on the Shanghai Futures Exchange gained 1.5% to ​97,030 yuan ($14,093.57) a ‌ton, following a rise ⁠to 97,250 yuan - ⁠the highest since March 19. Metals also got a boost from data on Wednesday showing the private manufacturing ​sector in top metals consumer China expanded in March for a ‌fourth straight month.

That came after data from an official ⁠survey on Tuesday showed activity grew at the fastest pace in a year.

Higher premiums and falling Chinese inventories are showing physical copper demand is improving.

Stocks monitored by SHFE declined for a second consecutive week to 359,135 tons as of March 27.

"That indicates there was some pent-up demand and that the lower prices that we reached earlier this month did trigger some buying," Hansen added.

Metals gains were also buoyed by a weaker U.S. dollar , making greenback-backed commodities more affordable for investors using other currencies.

LME aluminium initially fell as investors reckoned that ‌supply issues from the Gulf smelters would improve if the war ⁠wound down. But prices rebounded 1.6% in official activity to $3,523 a ​ton after a consultancy said one major smelter had halted operations and another was only running at 30% utilisation.

Among other metals, LME zinc added 0.4% to $3,240 a ton, lead gained 1.3% to $1,928, nickel ​rose 0.7% to $17,225 and ‌tin climbed 2.1% to $47,745.

($1 = 6.8847 Chinese yuan renminbi)

(Reporting by Eric Onstad Additional ⁠reporting by Dylan Duan in ​Shanghai and Lewis Jackson in Beijing; Editing by Alexandra Hudson and Louise Heavens)