Mobil has been fined $288,000 for an oil spill in the Tauranga Harbour.
Bay of Plenty Regional Council prosecuted Mobil Oil New Zealand under the Resource Management Act.
Court documents show the heavy fuel oil spill on 27 April last year was the result of two holes in a corroded 30-year-old pipe.
Experts found the pipe, which was located just above the high tide level, had been compromised and the fault should have been picked up during routine inspections.
Between 2000 and 6000 litres of oil is believed to have spilled into the harbour causing environmental damage to vegetation and sealife.
The cleanup cost $1.187 million, which Mobil has reimbursed the council for.
The council's pollution prevention manager, Nick Zaman, said systematic failings were found with Mobil's maintenance.
"This sends a very clear message to all these people operating in a high-risk environment that they need to keep on top of their game.
"If you don't keep on top of maintenance it's a disaster waiting to happen. Companies should really take note that they need to keep on top of this - it's just not good enough to do things as an after-thought."
Mobil country manager Andrew McNaught has apologised for the incident and said they had learnt from it.
He said changes had been made to improve the Bay of Plenty operations.