Gibraltar was uninhabited during ancient times due in part to a lack of easily accessible water to support a permanent population, but in the 11th century the Moors established a fortified stronghold there in response to military threats from the Christian kingdoms of Aragon and Castile. The Moors obtained water through roof catchment of rainfall, shallow wells in the Quaternary sands to the west of the Rock of Gibraltar, and storing local surface runoff in cisterns. In the 14th century they constructed an aqueduct that collected water from the Red Sands, an area south of the town in the vicinity of what is now the Gibraltar Botanic Gardens, and transported it some to a fountain within the town. Fountain Ramp, on the western side of John Mackintosh Square, preserves in its name the location of the aqueduct's original terminus.