LONDON - Copper was heading for its first weekly gain in seven weeks on Friday after a surprise rise in Chinese factory activity raised hopes for improved demand while a deal to avert a U.S. debt default boosted stock markets and weakened the dollar.

Benchmark copper on the London Metal Exchange (LME) was up 1.2% at $8,340 a tonne in official ring trading after touching $8,381, its highest since May 11. It was up around 2.5% this week.

However, the metal used in power and construction is still down about 12.5% from its January peak owing to China's weak economic recovery and growth-stifling increases to interest rates elsewhere.

The Caixin/S&P Global manufacturing purchasing managers' index (PMI) on Thursday showed that Chinese manufacturing activity unexpectedly swung to growth in May, contradicting a weaker official PMI reading earlier in the week.

Meanwhile, the U.S. Senate passed legislation to raise the government debt ceiling.

With investors also betting that the U.S. Federal Reserve will not raise interest rates further at its next meeting, appetite for riskier, growth-linked assets grew.

Global stock markets rose and the dollar was heading for its biggest weekly drop since March, helping dollar-priced metals by making them cheaper for buyers with other currencies.

Economic and factory growth remain weak globally, but investors appear to have exhausted their desire to sell copper, said Saxo Bank strategist Ole Hansen.

Copper could move higher if it closes above its 200-day moving average, currently around $8,375, but a period of price consolidation is likely, Hansen said.

"To move higher, we need some improvement in the economic numbers," he added.

Other industrial metals also rose. LME aluminium was up 0.3% at $2,289 a tonne, zinc rose 2.4% to $2,321, nickel gained 1.2% to $21,565, lead was up 0.3% at $2,004 and tin jumped 1.8% to $25,900.

(Reporting by Peter Hobson Additional reporting by Siyi Liu and Dominique Patton Editing by David Goodman, Kirsten Donovan)