Private prison operator Serco has been ordered to pay $8 million to Corrections over the problems at Mt Eden Prison.
The department took over the management of the Auckland remand facility last July after allegations of assaults and organised fight clubs.
Corrections Minister Judith Collins said the multi-million dollar payment would cover the costs of the department stepping in and of performance penalties.
The amount matched what the government had awarded Serco in performance bonuses since 2011.
Ms Collins said Serco had been ordered to pay some of that back.
"The performance notices that Corrections has provided to Serco are under its contract so if Serco didn't do certain things then there is a fine - and so it includes those as well.
"I can't give any further breakdown of it because it's a mediated settlement but I'm very pleased with the outcome."
Serco had previously been served with 55 breach of contract notices since it took over running the prison in 2011, paying $1.4m in fines.
The department will continue to manage Mt Eden, with Serco providing personnel at cost, until the end of the private operator's contract in March next year. Ms Collins said Serco would make no profit from the arrangement.
Serco's Asia Pacific chief executive Mark Irwin said, in the period before the department stepped in, the company had failed to meet its contractual standards or its own standards.
"For that I am truly sorry," Mr Irwin told reporters.
Mr Irwin said the least disruptive and most sensible path forward was for Corrections to continue to run the prison, and Serco to provide staff.
The department announced in December that Serco's contract would not be extended when it ended in March 2017, after an investigation into the alleged assaults and fight clubs as well as into drinking and drug use at the prison.
The investigation was completed in December by the Chief Inspector of Corrections, with independent oversight from the Ombudsman, and handed to the department's chief executive Ray Smith.
Mr Smith said Serco's staff would continue to work at the prison until its contract ended in March next year, but it would remain under government control.
"Practically and pragmatically we've been running it for the past nine months. The idea that we would hand that back for the next 12 to Serco doesn't really make any sense, so we're not doing that, we're going to carry on and keep running it.
"And we both agree that that's the right thing to do."
He would not comment on whether he thought the prison should still be privatised, and said he would advise the government on its options once Serco's contract ended.
Serco went to the High Court in Wellington in February to challenge the chief inspector's report. The judge reserved her decision and the report itself remains suppressed.
Ms Collins said the decisions were separate from the report, which was currently before the courts.
She would not rule out the possibility that Serco could run the prison again, telling Checkpoint with John Campbell that they might wish to tender for the contract in the future.
"We've always chosen not to rule out providers, because we always think you've got to look at these on the facts and what you know at the time."
Listen to Judith Collins