The Minoan civilization on the Greek island of Crete was the first civilization to use underground clay pipes for sanitation and water supply. Their capital, Knossos, had a well-organized water system for bringing in clean water, taking out waste water and storm sewage canals for overflow when there was heavy rain. It was also one of the first uses of a flush toilet, dating back to the 18th century BC. The Minoan civilization had stone sewers that were periodically flushed with clean water.
In addition to sophisticated water and sewer systems they devised elaborate systems to heat the water. An inverted siphon system, along with glass covered clay pipes, was used for the first time in the palaces of Crete, Greece. It is still in working condition, after about 3000 years.
Sedimentation tank and cistern from Minoan Crete