* Freeport can now apply for 10-yr Grasberg permit extension
* Grasberg is world's 2nd biggest copper mine
* Timing, valuation of 51 pct divestment yet to be finalized
* Freeport says makes "major concession" on divestment, smelter (Adds Freeport statement, share move)
JAKARTA, Aug 29 (Reuters) - Indonesia has reached a deal to let Freeport-McMoRan Inc keep operating its giant Grasberg copper mine, after the U.S. company agreed to sell a majority stake following years of wrangling.
Freeport said on Tuesday it had made a "major concession and compromise" in agreeing to sell a 51 percent stake, and to build a second smelter in Indonesia.
The company said the deal would be structured in a way that Freeport would retain control over the operations and governance of its Indonesian business.
"We are committed to completing the documentation as soon as possible during 2017," Chief Executive Richard Adkerson said in a statement.
Freeport's shares were marginally down at $15.46 in premarket trading.
Freeport has been in talks with Indonesia since late 2009 to work out how to shift to a new permit for Grasberg, the world's second-biggest copper mine, as mandated in a mining law passed that year.
Top-quality copper mines remain rare and the agreement underlines the mine's importance to Freeport, the world's biggest publicly listed copper miner, which produces a quarter of its copper from Grasberg.
It also marks the return of a more muscular stance from a host government, a trend that was common during the commodities boom.
Freeport can "immediately apply" for a 10-year permit extension to mine at Grasberg beyond 2021, said Indonesian Energy and Mineral Resources Minister Ignasius Jonan, and a second extension could be proposed before 2031.
"The mandate of the president, which has been agreed to by Freeport, is that the divestment should reach 51 percent," Jonan told a joint news conference, alongside Adkerson. "All that is left is to discuss the timing. The price will be negotiated later."
Freeport will need to divest a further 41.64 percent of its Indonesian unit to a local entity to comply with new local ownership rules introduced in January, on top of the 9.36 percent stake it has already divested to the government.
Freeport has insisted on a "fair market value" for the divested stake, while the government is seeking a much lower figure and said it should not include unmined copper reserves.
Last year, Freeport offered a 10.64 percent stake in Grasberg for $1.7 billion, valuing the mine at about $16.2 billion. The government counter-offered at $630 million.
"The mechanics, valuation and timing of the 51 percent divestiture are all absolutely critical issues which must be resolved before the dispute can be regarded as finally settled," Jakarta-based foreign legal counsel Bill Sullivan told Reuters.
"BETTER THAN NOTHING"
The agreement also reduces the risk of another stoppage to copper concentrate exports from Grasberg. Global prices for the metal jumped earlier this year when negotiations soured and exports were halted.
"If it wasn't copper, this may have played out differently. But given copper's long-term positive outlook and the billions of dollars already invested by Freeport in Grasberg, they must realize that 49 percent is better than nothing," said James Wilson, mining analyst for Argonaut Stockbroking in Perth.
During Freeport's five decades of operating Grasberg, in Indonesia's eastern province of Papua, there has been frequent friction between the government and the company over revenue sharing and the mine's social and environmental impact.
Labour unrest emerged at Grasberg after Freeport put about 3,000 workers on indefinite leave earlier this year, as a result of the dispute over mining rights.
"We hope that this (agreement) also brings to an end the worker strike," Tri Puspital, a leader at one of the Freeport workers' unions, said on Tuesday.
Talks between Freeport and the government on Grasberg became more urgent this year as the company's existing 30-year contract is due to expire in 2021 and the government demanded the mine accept the new permit or copper concentrate exports would be stopped.
The new permit would also require Freeport to relinquish arbitration rights, pay new taxes and royalties, and develop a new copper smelter, among other terms.
Energy Minister Jonan said last week this transition would be a "test case" for Indonesia's mining sector.
The latest deal may help give some certainty to Freeport, which had sought to extend its operations to 2041 before committing to a multi-billion dollar expansion of its Grasberg mining operations underground from an open pit.
It also may help provide the legal and fiscal rights Freeport had requested to be carried over from its current contract.
Adkerson said the existing contract of work would remain in place until everything was settled and documented, and stressed that the company had given ground.
"I want to emphasize that our willingness on the agreement to divest a 51 percent (stake) and to build a smelter is a major concession and compromise on our part," said Adkerson, adding the company plans to invest between $17 billion and $20 billion in Grasberg through 2031.
Finance Minister Sri Mulyani Indrawati told the news conference the government was in the process of drafting new rules on taxes and royalties for miners.
Under these rules, the government expects to increase its revenues from Freeport, and the miner could maintain tax rates for "the duration of its operations," Mulyani said. (Additonal reporting by James Regan in Sydney and Yashaswini Swamynathan in Bengaluru; Writing by Fergus Jensen and Ed Davies; Editing by Christian Schmollinger and Susan Fenton)