"Through the long process of negotiation, with patience not to do it repressively, our priority has been the safety of the pilot through this long process," Indonesian President Joko Widodo said in televised remarks, Reuters reported.
Mehrtens was freed and picked up by a joint team in Nduga Regency and was undergoing health check-ups and a physiological examination in Timika regency, the police said.
"We are prioritising approach through religious leaders, church leaders, traditional leaders and Egianus Kogoya's close family to minimise casualties and maintain the safety of the pilot," the chief of Cartenz 2024 Peace Operations, Brigadier General Faizal Ramadhani, said in a statement released to media.
"We managed to pick him up in good health," Cartenz spokesman Bayu Suseno told the Associated Press.
Mehrtens did not appear to suffer any post-traumatic stress although he had lost a lot of weight, and he should be able to fly out of Papua soon, said Bambang Trisnohadi, a lieutenant general with the Indonesian military.
Mehrtens will be flown to Jakarta in an air force plane due to arrive later tonight, the police said.
The armed faction of the West Papua National Liberation Army kidnapped Merhtens in February 2023 after he landed a small commercial plane in a remote, mountainous area.
Indonesia has previously said it had prioritised talks with religious and community leaders to free the pilot, as a military operation in the rugged highland area presented dangers.
Foreign Minister Winston Peters welcomed the release, saying it was "always a concern" that negotiations to free Mehrtens may not succeed.
"We are pleased and relieved to confirm that Phillip Mehrtens is safe and well and has been able to talk with his family. This news must be an enormous relief for his friends and loved ones," Peters said in a statement.
For the last 19-and-a-half months, a wide range of government agencies had been working with Indonesian authorities and others towards securing Mehrtens' release, Peters said.
"The Ministry of Foreign Affairs and Trade, with staff in both Indonesia and Wellington, has led a sustained whole-of-government effort to secure Phillip Mehrtens' release, and has also been supporting his family."
Peters said he also wanted to acknowledge the cooperation and restraint showed by many media outlets in relation to this case.
"The case has taken a toll on the Mehrtens family, who have asked for privacy. We ask media outlets to respect their wishes and therefore we have no further comment at this stage."
Indonesian President Joko Widodo told reporters that Jakarta had secured Mehrtens' safety through negotiation, instead of force.
"We prioritised the safety of the pilot who was held hostage. It took a long process and I appreciate the authorities," Australia's SBS reported him as saying.
Speaking to media in Papatoetoe, South Auckland, on Saturday evening, Peters said the release was an "enormous relief".
"It's one of the better stories I've had in my career, I have to say."
He said the negotiation was nerve-wracking.
"It was always a concern of ours that we might not succeed.
"The hardest thing in an environment with no trust is to establish trust."
Peters said he had not yet spoken to Mehrtens.
"I think there will be other people he wants to talk to before us."
Prime Minister Christopher Luxon said he was "grateful" that Mehrtens had been released.
"My appreciation to all those in Indonesia and New Zealand who have supported this positive outcome for Phillip and his family."