Lerwick's sewer system, with many pipes which are thought to be more than 100 years old, has been upgraded as part of a £5m project.
It is hoped Lerwick's environment will now be cleaner
The Scottish Water work was part of the project to upgrade the Shetland town's waste water treatment works.
The water company said the work was "vital" to bring the system up to required standards.
A further £10m is being invested to improve drinking water for thousands of people throughout Shetland.
Jim Green, project manager for Scottish Water Solutions, said: "The improved level of treatment is great news for the local coastal environment.
"In addition, the sewer system under the town is in much better condition as we had to refurbish a lot of it to prevent sea water getting in and disrupting the treatment process.
"All round, this £5m investment makes Lerwick and the local environment cleaner for locals and visitors."
The additional drinking water upgrades for remoter areas will involve Unst, Mid Yell, Sandy Loch, Cullivoe, Whalsay, Bressay, Eela, South Yell, Fetlar, Skerries, Fair Isle, Foula and Papa Stour.