The Idrisids founded the city of Fes, which became their capital and the major political and cultural center of early Islamic Morocco. In this early period Morocco also absorbed waves of immigrants from Tunisia and al-Andalus (Muslim-ruled Spain and Portugal), who brought in cultural and artistic influences from their home countries. The earliest well-known Islamic-era monuments in Morocco, such as the al-Qarawiyyin and Andalusiyyin mosques in Fes, were built in the hypostyle form and made early use of the horseshoe or "Moorish" arch. These reflected early influences from major monuments like the Great Mosque of Kairouan and the Great Mosque of Cordoba. In the 10th century much of northern Morocco came directly within the sphere of influence of the Umayyad Caliphate of Cordoba, with competition from the Fatimid Caliphate further east. Early contributions to Moroccan architecture from this period include expansions to the Qarawiyyin and Andalusiyyin mosques and the addition of their square-shafted minarets, the oldest suriving ones in Morocco, which anticipate the standard form of later Moroccan minarets.