Phoenix, Arizona-based Freeport said a months-long export ban by the Indonesian government at its massive Grasberg mine in the country had been costly, clipping production and sales, with more challenges ahead.

Still, shares of the world's biggest publicly listed copper miner gained as much as 9 percent, before edging back to $12.98, a 6 percent gain.

Freeport is ramping up output and copper concentrate shipments from Grasberg, the world's second biggest copper mine, after gaining a six-month export permit Friday that coincided with U.S. Vice President Mike Pence's state visit.

"The market is used to bad news on the Indonesian front, so anything that can be construed as optimistic is what the market is focusing on," said Clarksons Platou analyst Jeremy Sussman of the temporary permit.

New rules in Indonesia require miners to divest a 51 percent stake, relinquish arbitration rights and pay new taxes and royalties. Freeport says it will only agree to a new permit with the fiscal and legal protection in its current contract.

Chief Executive Richard Adkerson said the cost of failure would be high for Freeport and its Grasberg joint venture partner Rio Tinto. Speaking on a conference call with analysts, he said Indonesia would also be hurt, noting the government lost almost $500 million in taxes and royalties from the export ban starting Jan. 12.

Separately in an SEC filing on Tuesday, Freeport said Adkerson's total compensation for 2016 was about $16 million versus $8.6 million in 2015.

Freeport has cut about 10 percent of its 32,000 Grasberg workforce and spending on underground expansion by one-third.

It will "significantly" cut Indonesian spending, planned at about $1 billion annually for the next five years, if it does not gain a permit. Some $700 million of its $1.6 billion 2017 capital budget is earmarked for Grasberg's underground expansion.

In the first quarter, consolidated sales of 809 million pounds of copper and 182,000 ounces of gold lagged Freeport's January forecast of 1 billion pounds of copper and 460,000 ounces of gold.

Freeport said it deferred sales of 190 million pounds of copper and 280,000 ounces of gold under the ban.

It also cut its 2017 sales forecast to 3.9 billion pounds of copper and 1.9 million ounces of gold, from 4.1 billion pounds of copper and 2.2 million ounces of gold.

Freeport's adjusted profit of 15 cents a share and revenue of $3.34 billion trailed analyst estimates of 16 cents and $3.46 billion.

(Reporting by Susan Taylor; Editing by Meredith Mazzilli and Diane Craft)

By Susan Taylor