Napier City Council is being threatened with prosecution if it fails to fix a pipe leaking wastewater into the Pacific Ocean.
A wastewater pipe built in the 1970s in Awamoto, south of the city centre, has been problematic from its early days due to poor construction and design.
Hawke's Bay Regional Council said it could take enforcement action against Napier council if it was not fixed by 30 October.
In a report for Thursday's Napier City Council (NCC) meeting, staff estimated replacing the outfall could cost up to $40 million.
By 2003, there had been eight significant leaks which had to be repaired.
Historically the outfall had not been regularly inspected but changes were made and in an August 2018 inspection, divers found sticks, fishing net and weeds inside the outfall.
This led to the discovery of a small leak about 70m from the shore and more significant seepage about 700m from the shore.
In late April this year, another leak due to the failure of an old repair was found closer to shore.
Repairing it again could result in more damage, the report said.
Council staff acknowledged doing nothing was not an option.
"It is unlikely that the regional council will not agree with this option, resulting in taking enforcement action against the council," the report said.
"This can also cause damage to the [Napier] council's reputation."
NCC needed to complete short-term repairs to stop the leak and give longer term options for repairing the pipe by October 30.
Otherwise, the regional council could take enforcement action.
"With escalating maintenance costs, current capacity constraints and increased risk of failure, it is recommended that [the] council start preparing for the replacement of the outfall and identify required funding to start this process," the report said.
The replacement would be costly - council staff estimate it could cost between $20 million and $40 million, although only $11 million was forecast in the latest long term plan.
Councillors will make a decision on whether or not to replace the outfall at a meeting tomorrow.