Some 1,500 metres downstream from the Allahverdi Khan Bridge, another great work was created around 1650, in the reign of Shah ‘Abbas II: the Khwaju Bridge. This stands on the line of the Maidan, and performs a dual function: it regulates the course of the river, by means of floodgates that can block its eighteen arcades to create a dam, and it provides a river crossing with flanking covered passageways for pedestrians, as on the Allahverdi Khan Bridge. To help the bridge resist the pressure of the water when the floodgates are closed, the engineer provided wider sections at the two ends of the roadway, and a massive pair of semi-octagonal structures in the centre on specially substantial foundations. The base on which the bridge stands has locks at this point. A vaulted passage that runs along the base below the roadway gives access to the floodgates. Technology and hydraulic engineering here came together to produce a work with the crucial purpose of providing water for a constantly growing population and for an ever-increasing number of pools and fountains in the city.