Major changes in the Jewish population also took place when in 1492 the Spanish crown expelled all Jews from Spain, with Portugal doing the same in 1497. The following waves of Spanish Jews migrating to Fez and North Africa increased the Jewish population and also altered its social, ethnic, and linguistic makeup. The influx of migrants also revitalized Jewish cultural activity in the following years, while splitting the community along ethnic lines for many generations. In Fez, for example, the "Megorashim" of Spanish origin retained their heritage and their Spanish language while the indigenous Moroccan "Toshavim", who spoke Arabic and were of Arab and Berber heritage, followed their own traditions. Members of the two communities worshiped in separate synagogues and were even buried separately. It was only in the 18th century that the two communities eventually blended together, with Arabic eventually becoming the main language of the entire community while the Spanish (Sephardic) "minhag" became dominant in religious practice; a situation which was repeated elsewhere in Morocco, with the notable exception of the Marrakesh community.