As Freeport-McMoRan Inc. celebrates an arrangement to end a multi-year dispute with Indonesia over the giant Grasberg mine, investors are fretting over the costs.

Shares in Phoenix-based Freeport fell the most among mining peers on Tuesday after the company said it reached an “understanding” with the government of Indonesia that will allow it to continue to operate its flagship copper-and-gold asset through 2041.

Under the terms of the deal, Freeport will divest an additional 41.64 percent of PTFI, its Indonesian unit, to bring local ownership to 51 percent. It will also commit to spending up to $20 billion by 2031 to further develop the asset, including completing a new smelter within five years. The divestment will take place “at fair market value,” and Freeport will retain control over operations and governance, it said in a statement.

“Now comes the push-comes-to-shove moment,” Jeremy Sussman, an analyst with Clarksons Platou Securities Inc., said by telephone. “We’ve set the stage for figuring out what the government thinks 51 percent is worth and what Freeport thinks 51 percent is worth. It’s going to be difficult to expect the government to pay fair value.”

Meanwhile, Freeport’s pledge to spend $17 billion to $20 billion will result in higher annual spending than he expected, Sussman added, although it’s a good sign that Freeport feels comfortable investing in the asset over the long term.

‘Significant Uncertainty’

Freeport will continue to discuss the pricing and timing for investment with the Indonesian government, the company said. A final agreement will need to be documented and approved by Freeport’s board and partners.

Until that approval takes place, there is “significant uncertainty” about Grasberg’s future, Paul Forward, an analyst with Stifel Nicolaus & Co., said in a note Tuesday. “We take the announcement of the framework as a positive sign of progress in Freeport’s negotiations with Indonesia, but we expect that the process of ironing out details will be lengthy.”

In addition to the issue of determining fair value, it’s not clear whether PTFI could be restricted from exporting copper concentrate when its temporary license expires in October, Forward wrote. In contrast, Sussman interpreted Tuesday’s news as suggesting exports would be allowed to continue beyond October.

Chief Executive Officer Richard Adkerson hailed the progress as “positive for all stakeholders,” in the statement. “Important work remains on documenting this agreement and we are committed to completing the documentation as soon as possible during 2017.”

Value Estimate

The statement followed a news conference in Indonesia in which Adkerson flanked Indonesian Energy and Mineral Resources Minister Ignasius Jonan as they detailed progress reached over months of negotiations. The talks were triggered by a government decision in January to demand all foreign companies switch to special mining licenses under new terms. Freeport has been seeking to extend its long-term rights to operate Grasberg for years.

While the two sides haven’t set a deadline to complete the divestment, Jonan said Freeport could immediately apply for a new license valid from 2021 which will allow it to operate the massive pit until 2041 if it meets three requirements: divestment, completing a smelter by October 2022 and higher state revenue. The government will provide fiscal and legal certainty over that operating period, Freeport said.

Freeport directly owns 81.28 percent of PTFI and has a 9.36 percent indirect stake through a subsidiary. The Indonesian government owns the other 9.36 percent.

“We value Grasberg at more than $11 billion, and would expect FCX to realize nearly $5 billion in proceeds from a fair market divestiture of additional stake to bring its ownership down to 49%,” Mike Dudas, an analyst with Vertical Research Partners, said in a research note following the announcement.

The deal is set to burnish Indonesian President Joko Widodo’s credentials as a champion of national interests ahead of his re-election bid in two years time. It may also come as a relief to Freeport, whose operations have been hobbled since a dispute over licenses began in January. At the same time, it risks undermining the confidence of foreign firms investing in the Southeast Asian nation.

Freeport’s willingness “to divest and build a smelter is a major concession and compromise on our part,” Adkerson told reporters. Grasberg will require an investment of as much as $20 billion through 2031 to further develop the mine, including construction of a smelter.

“It’s a bit early to say whether Freeport caved in or not,” Helen Lau, an analyst at Argonaut Securities Asia Pty, said by phone from Hong Kong. “We don’t know the price of the transfer, or whether the government will defray some of the mine costs in terms of royalties or taxes, for example,” she said.

“Freeport knows this mine very well and must understand it can be maintained at low costs in the long term. Ultimately this is profit driven and by agreeing this deal Freeport can potentially benefit for 20 years,” according to Lau.

Freeport shares fell as much as 5.7 percent in New York even as copper prices advanced. The stock is up 13 percent this year, underperforming copper’s 23 percent gain in London as prospects for demand growth in China improve.

As well as being its biggest copper asset, Grasberg accounted for most of the company’s 1.09 million ounces of gold production last year. Freeport generated 18 percent of its revenue from Indonesia in 2016, according to data compiled by Bloomberg.

Rio’s Role

Rio Tinto Group, the world’s second-biggest miner, also has an interest in Grasberg through a joint venture with Freeport. Under the terms of their partnership, Rio is entitled to a 40 percent share of output above specific levels until 2021 and 40 percent of all production after that year. Rio didn’t immediately respond to emailed requests for comment.

Earlier this month, Jonan had said Freeport would be allowed to continue as operator of Grasberg until an Indonesian company has the capacity to take over. The idea of an initial public offering of a 10 percent stake has also been floated to help establish a valuation for the local unit.