In 1012, the Emir of Mecca Abu'l-Futuh al-Hasan declared himself caliph, but he was persuaded to give up his title in the same year.[1] The first Sulayhid ruler conquered the whole of Yemen in 1062, and proceeded northwards to occupy the Hejaz. For a time, they appointed the Emirs of Mecca.[9] As Sunni power began to revive after 1058, the Meccan emirs maintained an ambiguous position between the Fatimids and the Seljuks of Isfahan.[9] After Saladin overthrew the Fatimids in 1171, the Ayyubids aspired to establishing their sovereignty over Mecca. Their constant dynastic disputes, however, led to a period free of external interferences in the Hejaz.[9]