When the Saadian dynasty made Marrakesh the capital again in the 16th century, they also restored the gardens of the city.[1]:282[2] It was the Saadians who initially built a pleasure pavilion overlooking the water reservoir.[2][3][4] However, the gardens owe their current condition to the reigns of the Alaouite sultans Moulay Abd ar-Rahman (ruled 1822–1859) and his son Muhammad IV (ruled 1859–1873), who restored and replanted both the Menara and Agdal gardens. Under the reign of Abd ar-Rahman, his son Muhammad was viceroy in Marrakesh and was responsible for carrying a part of the works, which then continued when Muhammad himself became sultan after his father.