The ancient town of Kairouan, Tunisia is located within a semi-arid region, prone to drought, without any nearby rivers or natural water sources. Water supply and storage has been a problem for more than a thousand years. The solution took the form of the majestic Aghlabid Basins, a huge and highly advanced work of engineering during the Middle Ages.
The hydraulic ensemble, built in the 9th century by the Aghlabid Dynasty, has provided water for townspeople in Kairouan for more than a millennium. The Aghlabid Basins are composed of two connected cisterns which together form an open-air reservoir, fed by a 36-mile aqueduct that sources water from the hills beyond town. Water flowed into the smaller pool, which serves as a sort of filter, collecting stray sediments before the water is transferred to the larger basin, which is an impressive 16 feet deep and 420 feet in diameter.
The basins would fill up with rainwater, which would be used for washing or for emergency hydration, though contamination always posed a major risk. Still, the system is remarkably sophisticated engineering feat for its time, and considered the largest hydraulic installation of the Middle Ages. Originally, there were 16 of these pools, though just the two remain today. Though the pools appear circular, they are in fact 17-sided polygons.
The basins are named for the the Arab-Muslim dynasty for which Kairouan served as the capital city: The Aghlabids ruled the region known as Ifrīqīyah (Tunisia and eastern Algeria) from 800 to 909. The basins were built under the instruction of Prince Abū Ibrāhim Aḥmad, one of the 11 Aghlabid emirs, who was known for commissioning many public works—water works being perhaps the most crucial among them.
Today, if you are in Kairouan, you can visit the now completely excavated basins. The area has been established for visitors, though the water is still not recommended for drinking.