The Yufirid emir Abdullah ibn Qahtan attacked and burned Zabid in 989, severely weakening the Ziyadid dynasty. The Ziyadid monarchs lost effective power after 989, or even earlier than that. Meanwhile, a succession of slaves held power in Zabid and continued to govern in the name of their masters, eventually establishing their own dynasty around 1022 or 1050 according to different sources. Although they were recognized by the Abbasid Caliphate in Baghdad, they ruled no more than Zabid and four districts to its north. The rise of the Isma'ili Sulayhid dynasty in the Yemeni highlands reduced their history to a series of intrigues.