(Adds quotes, context)
By Agustinus Beo Da Costa and Wilda Asmarini
JAKARTA, Dec 21 (Reuters) - Indonesia's state-owned miner PT Inalum on Friday took control of the local unit of Freeport-McMoRan Inc, operator of the world's second-biggest copper mine Grasberg, with the closure of a $3.85 billion deal.
The landmark deal, which hands Inalum a 51.23 percent stake in PT Freeport Indonesia, ends years of tough and often fractious negotiations over ownership rights to Grasberg as Jakarta pushed for greater control over its mineral wealth.
"Today is a historical moment since Freeport began operating in Indonesia in 1973," a smiling President Joko Widodo told reporters at a press conference.
"Everything has been completed, and now all that's left is the work," he added.
For Widodo, seeking reelection next year, securing the majority stake in the mine for Indonesia is a political boon, and he had urged both sides to wrap up the deal quickly.
Indonesia and Freeport agreed in principle in August 2017 to set up Freeport's rights to Grasberg according to a new mining license but the process was held up by numerous issues, including resolution of environmental problems linked to the mine.
"Today we have completed the lengthy process to transfer Freeport's contract of work to a special mining permit," Coal and Minerals Director General Bambang Gatot Aryono told reporters at separate press conference.
Aryono said the new permit given to Freeport Indonesia is valid until 2031, and the company could apply for a 10-year extension five years before it expires.
Freeport McMoRan chief executive Richard Adkerson said the new permit would give the company clarity over its Indonesian operations up to 2041.
Under the terms of the new agreement, Freeport will build a copper smelter in Indonesia within five years, and will invest an estimated $14 billion in the mine.
Inalum chief executive Budi Gunadi Sadikin said Grasberg was "the most complex mine in the world" with plans to expand a network of tunnels to 1,000 kilometres from around 700 kilometres at present.
"I'm confident Indonesia's engineers can do this," Sadikin said. "But we need to study, and Freeport McMoRan is the best proven underground mining operator, so this is the best opportunity for us to study."
Newly appointed Freeport Indonesia chief executive Tony Wenas said operations at the giant Grasberg open pit will conclude this year, resulting in a temporary decline in output as it transitions to underground mining.
"In 2020, production will increase again," he said.
Wenas also noted recent separatist unrest in Nduga, which lies on the other side of a mountain range from Grasberg, but said the mine was safe.
"We hope in future it will be safer."
Additional reporting by Bernadette Christina Munthe and Gayatri Suroyo; Writing by Fergus Jensen; Editing by Tom Hogue and Kirsten Donovan