Supreme Court judge Bill Willson has resigned in a move which will cost the Crown close to $1 million.
Justice Wilson has been under investigation for alleged misconduct relating to conflicts of interest.
The High Court recently referred the case back to the Judicial Conduct Commissioner, saying the commissioner erred when establishing a judicial panel and the parameters of its investigation.
The Government on Thursday announced Justice Wilson has resigned, effective from 5 November.
Justice Wilson will receive one year's salary of $410,000 and the Crown will also pay his solicitor-client costs of $475,000 to date.
He will also receive other entitlements such as untaken leave.
Resignation the 'best outcome'
Acting Attorney-General Judith Collins says the case could have taken another year to 18 months to resolve and the judge would have been effectively on "garden leave" until then.
Ms Collins told Checkpoint on Thursday that Justice Wilson offered to resign some weeks ago, but the terms were unacceptable.
"He has now offered to resign on terms that are acceptable to me, that I have judged are in the best interests of the country, of the judiciary and of the taxpayer."
Ms Collins says she believes the resignation is the best outcome under the circumstances, and resolves an unprecedented situation in New Zealand's legal history.
She to proceed with the case would have caused incalculable damage to confidence in the judiciary, and greater cost to the Crown, which is liable for Justice Wilson's legal costs.