Copper prices in London hit a two-year high and tested a strong resistance level of $10,000 a metric ton on Friday after Shanghai prices hit a record high on fund buying.

Three-month copper on the London Metal Exchange was up 1.3% at $9,990 a ton in official open-outcry trading after peaking at $10,033.50 for its highest since April 2022.

Copper, used in power and construction, attracted additional attention from investors after BHP Group's takeover proposal to Anglo American, which the London-listed miner rejected on Friday, saying the $39 billion bid undervalued its future prospects.

"Speculation over supply shortfalls in copper are pushing prices to new highs. At the same time, investors are turning optimistic about demand from the green energy sector. BHP's bid for Anglo American highlights the looming supply squeeze," said ING commodities analyst Ewa Manthey.

Among the key drivers are the concerns about tight supply of the raw material, which is evident from low spot copper treatment charges in top consumer China, said Dan Smith, head of research at Amalgamated Metal Trading.

"Investors are still in the driving seat," Smith said. "It is very tempting to be long for copper, and we have seen investors adding fresh long positions four weeks in a row."

However, two other factors signal that copper could fail to remain at current elevated price levels in the months ahead, said Smith. First, net speculative positions are now high relative to the historical range. Secondly, the discount for LME cash copper over the benchmark three-month contract is rising.

The discount was last at $124.50 a ton, up from $78.8 a week ago. It hit a record high of $134.50 on April 9.

In other metals, LME aluminium rose 0.9% to $2,586.5 a ton, nickel was up 1.1% at $19,375 and tin added 0.9% to $33,150.

Zinc gained 0.4% to $2,858 after hitting a one-year high while lead advanced 1.0% to $2,230 after touching its highest in five months.

(Reporting by Polina Devitt in London Additional reporting by Mai Nguyen in Hanoi Editing by David Goodman)