The beach at Whitby had to be sealed off for several days as environmental experts dealt with the sewage that flowed out into the harbour at the port.
Yorkshire Water announced more than 1m was to be spent upgrading the town's sewer system, large sections of which date back to the Victorian era.
The major element of the wide-ranging scheme has now been completed after work costing 750,000 was carried out on a stretch of pipe running under the harbour.
The company's technicians have now strengthened the pipe to protect it from the tidal forces that had weakened it over the past 10 years.
Sewerage asset manager Miles Cameron admitted the Whitby upgrade had been deemed to be one of the most important schemes that needed in the Yorkshire region.
Mr Cameron said: "We are acutely aware about how important Whitby is to Yorkshire – as a tourism destination as well as a port.
"Repair projects are not only important for protecting our own assets, they are important to provide the required service for the region's communities, who after all do pay the bills.
"Whitby does have its own set of issues which have had to be dealt with. it is an extremely popular destination and we
have had to make sure we have kept any disruption to a minimum.
"The work on the pipe has now been completed and the repairs are aimed at preventing any similar problems to those which have been experienced in the past."
The pipe leaked raw sewage for three days in August 2008 and forced the closure of Tate Hill Beach in Whitby when the Endeavour Wharf pumping station had a mechanical breakdown.
Yorkshire Water engineers discovered the fault at the pumping station at Whitby harbour was preventing the raw sewage from being carried to treatment works.
After consulting the Environment Agency, the decision was taken to release the raw sewage into the sea to stop the pipe network clogging up.
The untreated waste was first discharged through an emergency outflow, and Yorkshire Water worked with Scarborough Borough Council as well as the Environment Agency to reduce the impact.
Tate Hill Sands beach was closed as a precaution but designated bathing beaches in the area remained open throughout the leak.
The pipe has now been sealed in concrete and a structural liner added inside to reinforce it and protect it from the pressures of extreme tidal forces.
Scarborough and Whitby MP Robert Goodwill was among local dignitaries who were given a tour on Friday to see what had been done.
Mr Goodwill said: "Whitby is the second biggest coastal resort in North Yorkshire after Scarborough and it was vital that the work was carried out.
"There were concerns that the problems of 2008 could have happened at any time if the repairs had not been carried out."
Yorkshire Water was named last week among six water companies that had failed to meet their leakage targets during the last year.
Regulator Ofwat's service and delivery report found the firm was 7.3 per cent over its leakage target for 2009-10 – the worst of any of the 21 water companies in England and Wales.
The regulator said that although water companies continued to deliver good, reliable service to most consumers, dealing with leaks remained a serious concern as Cambridge, Dee Valley, Northumbrian, Southern, Veolia Central and Yorkshire all missed their targets.
However, Yorkshire Water claimed that the last winter, the harshest for more than 30 years, had caused major leak problems.
Computers to help tackle woes
A computer system mapping Whitby's ageing sewer system is due to go live by the end of next year.
Yorkshire Water officials are undertaking a survey of the port's sewers to create a 3-D mapping tool to cut leaks and improve the monitoring of the underground network.
Yorkshire Water has admitted the town's sewer system, large sections of which date back to the Victorian era, has been placed under increasing pressure from developments built over intervening decades.
The new 350,000 computer system will be one of the first of its kind to be used in the region, although similar technology is already being employed for the Upper and Lower Don Valleys in South Yorkshire and at Withernsea in East Yorkshire.
The sewerage asset manager at Yorkshire Water, Miles Cameron, said he hoped that the new computer technology for Whitby would be operational by the end of next year.
Whitby has endured a series of flooding problems where raw sewage has been forced out of manholes in heavy rainfall, leading to streams of effluent spurting into Church Street and Bridge Street.
Yorkshire Water has been attempting to address the problems, and repairs have already been carried out to manhole covers and attempts are under way to reduce a build-up of water pressure.