Harmful ecological affects were only avoided "by good luck" when a transformer oil company discharged between 5000 and 6000 litres of oil into the stormwater network last year.
The company eNZoil (NZ) Ltd, which takes waste transformer oil and refines it into a usable product, discharged the oil, which then ran into the Seaview Marina, on March 17 and 18, 2019.
Greater Wellington Council laid charges against eNZoil, which appeared before Judge Dwyer in the Wellington District Court on Wednesday and was fined $90,000 for the offence.
Dwyer said the discharge was a result of gross negligence and significant failures.
"Given the proximity to the marina and the direct connection to the stormwater system, they should have been aware of the risks," he said.
"Processes should have been undertaken with the highest degree of care."
Despite being refined, the oil produced by eNZoil is still toxic to aquatic life. The company assisted in the clean-up of the operation at the time, along with GWRC Harbours and Environmental Protection staff, Hutt City Council and the Marina.
The discharge had occurred due to failures in operations, such as not closing a valve which should have contained the spill.
No penguins were harmed as the spill occurred after breeding season, but the judge considered impacts such as the odour in the marina and fouling of boats.
He also acknowledged eNZoil was an environmentally focused organisation.
"With this spill there was the potential for significant adverse ecological effects which were only avoided by good luck."
Greater Wellington Council Environmental Regulation Team leader James Snowdon said it was important businesses were aware of the risks of discharging harmful substances.
"The majority of sites have drainage systems that lead directly to streams or the sea without any treatment," he said.
"In these instances only rainwater should be entering the network. Operators should plan carefully and if they don't understand the regulatory requirements, seek advice.
"We would rather be advising people on how to avoid and minimise impacts on the environment than taking them to court."