Rio Tinto has signed a non-binding agreement with PT Indonesia Asahan Aluminium (Persero) (Inalum), and Freeport McMoran Inc. (FCX) in relation to the future ownership of the Grasberg mine in Indonesia, one of the world’s largest copper and gold mines in terms of ore reserves and production.

According to Rio Tinto, the agreement lays out the terms for the sale of the company’s interest in the mine to Inalum, Indonesia’s state mining company, for $3.5 billion.

It also details the terms for a proposed transaction between FCX and Inalum for the latter to buy an additional stake in Grasberg as well as additional terms relating to the future ownership and operation of the mine.

“All parties have committed to work towards agreeing and signing binding agreements before the end of the second half of 2018,” Rio Tinto said in a statement.

“Given the terms that remain to be agreed, there is no certainty that a transaction will be completed. Any final agreements will be subject to approval by the necessary government regulators and authorities.”

The Grasberg mine is currently owned by FCX, who hold a 90.64% interest, and the Government of Indonesia, who own the remaining 9%.

As per the participation agreement signed on 11 October 1996, Rio Tinto currently has a right to 40% of production above a pre agreed level and 40% of all production after 2022.

Last year the mine produced 468kt and Rio Tinto’s share of mined copper was 5.7kt.