In Fez, the 17th century saw a significant influx of Jews from the Tadla region and from the Sous Valley arriving under the reigns of the Alaouite sultans Moulay Rashid and Moulay Isma'il, respectively. A serious disaster, however, took place in 1790 to 1792 during a period of general turmoil for the city under Sultan Moulay Yazid. During these two years the sultan forced the entire Jewish community to move to the outlying Kasbah Cherarda on the other side of Fes el-Jdid. The Mellah was occupied by tribal troops allied to him, its synagogue was replaced by a mosque, and the Jewish cemetery and its contents were moved to a cemetery near Bab Guissa. Moreover, Moulay Yazid permanently reduced the size of the district by demolishing the old city walls around it and rebuilding them along a much smaller perimeter. It was only after the sultan's death that the chief Muslim "qadi" (judge) of Fez ordered the Mellah to be restored to the Jewish community, along with the demolition of the mosque built by Yazid's troops.