In addition to the geographic proximity of the two regions, there were many waves of immigration from Al-Andalus to Morocco of both Muslims and Jews. One of the earliest waves were the Arab exiles from Cordoba who came to Fez after a failed rebellion in the early 9th century. This population transfer culminated in the waves of refugees that came after the fall of Granada in 1492, including many former elites and members of the Andalusi educated classes. These immigrants played important roles in Moroccan society. Among other examples, it was the early Arab exiles from Cordoba who gave the Andalusiyyin quarter of Fez its name and it was Andalusi refugees in the 16th century who rebuilt and expanded the northern city of Tétouan.