son of Sulayman ibn Dawud appeared in Upper Egypt, but by this time the Hafizis—and Isma'ilism in general—had been reduced to small isolated enclaves. Still later, about the year 1324, an Isma'ili (and likely Hafizi) community is recorded in Usfun in Upper Egypt, and in Syria a Hafizi community is mentioned at the same time in the Baqi'a mountains near Safad. The last traces of these Hafizi communities are lost towards the end of the Mamluk period. Yemen Soon after the split, the Zurayid ruler Saba ibn Abu'l-Su'ud declared himself as the Hafizi dāʿī in Yemen, thus becoming the head of the Hafizi community there. By the time of his death in 1138, he had eliminated the rival branches of his family and established his rule over the city and hinterland of Aden. His successors were officially recognized as dāʿīs by Cairo and invested with honorific titles by al-Hafiz. The Zurayid dynasty lasted until the Ayyubid invasion of 1173. The last members of the clan held out in the fortress of Dumluwa until 1188, but they finally sold it to the Ayyubids and left Yemen for Abyssinia. Further north, Hafizi Isma'ilism was also adopted by some of the Hamdanids of Sana'a. Himas ibn al-Qubayb and his son Hatim were the first Hamdanid rulers to declare for the Hafiziyya. After Hatim ibn Himas' death in 1138, the dynasty collapsed in internal feuds, but was reunited by Hatim ibn Ahmad ibn Imran and his son Ali. Both engaged in warfare with the Zaydi imamate of Saada, while Ali also attacked the Tayyibis under Hatim ibn Ibrahim al-Hamidi in 1166–1169, pushing them out from Shibam Kawkaban into Haraz. In 1173, Ali assisted the Zurayids in defeating the Kharijite ruler of Zabid, Abd al-Nabi. Soon after his return, he confronted the Ayyubid invasion of Yemen. He lost Sana'a in 1174, but soon recovered it and held it until 1189. Ali and his brothers continued to contest control over the northern part of the country around Sana'a until the early 13th century. The slow and gradual Ayyubid conquest allowed Hafizi Isma'ilism to survive for some time in Yemen, as related by Ali's grandson, Badr al-Din Muhammad Ibn Hatim, who died . For a while it remained prominent enough that the fifth leader of the Yemeni Tayyibis, Ali ibn Muhammad ibn al-Walid (died 1215), composed a treatise attacking them and their doctrines. Unlike the Tayyibis, the