For a while, the mellah of Fez remained the only one. The second mellah was only created in the second half of the 16th century in Marrakesh, which by then had replaced Fez as the capital of Morocco under the new Saadian dynasty. Here too the Jewish population of the city had lived alongside the Muslim population. Many of them had come from the Atlas Mountain regions and from the nearby city of Aghmat, where a much older Jewish community had already existed.