The first period, from c. 909 to 969, when the Fatimids were based in Ifriqiya (modern Tunisia), and the second period, lasting until the end of the dynasty in 1171, when the Fatimids were based in Egypt. During the first period, the navy was employed mainly in the constant warfare with the Byzantine Empire in Sicily and southern Italy, where the Fatimids enjoyed mixed success, as well as in the initially unsuccessful attempts to conquer Egypt from the Abbasids and the brief clashes with the Umayyad Caliphate of Córdoba.