Hamilton City Council has been ordered to pay $54,000 after "carelessly" discharging 1.7 million litres of sewage into the Waikato River.
The council was sentenced at Hamilton District Court last week for the overflow of untreated wastewater which occurred at its central city wastewater pumping station in February 2018.
The wastewater, containing human sewage, flowed into the water for 19 hours before the problem was fixed.
Hamilton City Council notified the Waikato Regional Council and human error was found to be the cause of the primary and back-up equipment, designed to operate the pumps and alarms, being turned off by mistake.
The regional council prosecuted the city council for the breach under the Resource Management Act.
In her sentencing decision, Hamilton District Court Judge Melinda Dickey said the council was "careless" and the river "required a more robust set of protections".
"Any overflow would result in a direct discharge of untreated human effluent into a river of significance."
The sentence was reduced to recognise the council's early guilty plea and completion of a restorative justice process.
In a statement, the council said it had made 16 improvements to prevent similar discharge events recurring, had undertaken education and awareness programmes, carried out riparian planting and implemented a new internship programme.
No environmental damage or health concerns were reported by the community as a result of the wastewater entering the river.
Hamilton City Council city waters manager Maire Porter said the council was extremely remorseful for the wastewater spill and was committed to protecting the environment and ensuring overflows were minimised.
"We understand the community's connection to the Waikato River and the importance the awa holds to all who live in and around the city."
Hamilton City Council has spent $40,000 on legal fees so far in relation to the prosecution. Restorative justice actions are still underway so a final cost could not be provided at this stage.