Glencore Plc said it’s in the final stages of agreeing to sell its stake in Mopani Copper Mines Plc to the Zambian government, ending months of uncertainty over the future of the troubled asset.

Glencore has been in talks with the state about Mopani since last year after the two clashed on the future of the mine, which has been unprofitable for years. Despite the challenges, the operations are a vital employer for Zambia.

Glencore said Friday it is in final-stage negotiations to sell the 90 per cent holding it owns with Vancouver-based First Quantum Minerals Ltd. to state-owned ZCCM Investments Holdings Plc, which already owns the other 10 per cent. Glencore did not provide details on the value of the sale.

Mopani was once central to Glencore’s plans to turn around its African copper business that’s been dogged by problems in recent years. The company spent billions of dollars to sink new shafts and, once fully up and running, the mines should produce about 140,000 tons of copper a year, compared with just 51,000 tons in 2019.

Glencore shelved its plans to place the operations under care and maintenance last year after Zambia threatened to revoke its mining license in April. The government’s strategy is driven by a need to safeguard jobs at the site.

Zambia’s increasingly tense relations with investors in the key copper-mining industry may partly reflect maneuvering by President Edgar Lungu ahead of elections this year. The government is also in arbitration over mining assets it seized in 2019 from billionaire Anil Agarwal’s Vedanta Resources Ltd.

Zambia last year became the first African country to default on its debt since the onset of the coronavirus pandemic. The government went into arrears in November, after failing to convince bondholders to freeze debt-service payments.