The Ziyadid dynasty was a Muslim dynasty that ruled western Yemen from 819 until 1018 from the capital city of Zabid. It was the first dynastic regime to wield power over the Yemeni lowland after the introduction of Islam in about 630.
Muhammad ibn Ziyad was a descendant of Ziyad, younger brother of the first Umayyad caliph Muawiyah I. In 814 he was arrested and brought to the Abbasid caliph al-Ma'mun on account of his ancestry, but his life was spared in the end. He was merely placed under surveillance and became the protégé of the caliph's minister al-Fadl ibn Sahl. Three years later a letter from the governor of Yemen arrived to Baghdad, complaining about attacks by the Ash'arite and Akkite tribes. Al-Fadl recommended al-Ma'mun to send the capable Muhammad ibn Ziyad to Tihama in order to suppress the tribes. The situation was particularly critical since the Alids under a leader called Ibrahim al-Jazzar threatened to detach Yemen from Abbasid control at this time. Muhammad ibn Ziyad was a sworn enemy of the Alids, which made him a suitable choice for the task. After performing the hajj, Muhammad marched south to Yemen with an army of Khurasani soldiers and arrived there in 818. He fought numerous battles against the tribes and won control over the Tihama lowland in the next year.
Following his victories, Muhammad was appointed amir of Yemen by al-Ma'mun with the task to restrain 'Alid Shi'a influence. Muhammad established a new city, Zabid, as his capital. It was built in a circular shape and situated midway between the sea and the mountains. He was able to expand his influence into Hadramawt and parts of highland Yemen, all the while recognizing Abbasid overlordship. The historian Umara enumarates his possessions as including Hadramawt, Diyar Kindah, Shihr, Mirbat in Oman, Abyan, Lahij, Aden and the maritime provinces as far north as Hali, furthermore the highland places Janad, Mikhlaf al-Ma'afir, Mikhlaf Ja'far, San'a, Sa'dah, Najran and Bayhan. However, the sources are somewhat obscure since the historian al-Hamdani asserts that another family, Banu Shurah, exercised paramount power in the Tihama for parts of the ninth century and were established in Zabid. From other sources it appears that San'a in fact continued to be governed by an Abbasid governor up to 847.
Little is known about the economic structure of the Ziyadid realm, but the historian Umara writes that the dynasty was bolstered by the flourishing international trade. The ruler received duties from ships coming from India. From the east came luxury products such as musk, camphor, ambergris, sandalwood and porcelain. From Africa came Ethiopian and Nubian slaves via the Dahlak Archipelago. Umara also mentions taxes on ambergris collection at Bab al-Mandab and the south coast, and on pearl fishing.
Meanwhile, Abbasid rule in Arabia was declining. After the violent end of caliph al-Musta'in in 866, the second Ziyadid ruler, Ibrahim ibn Muhammad, kept the tax revenues for himself and adopted royal trappings. He nevertheless continued reciting the khutba in the name of the Abbasids. As the Ziyadids' power tended to be concentrated on the lowland, and the Abbasid governors in the highland lacked support from their home base in Iraq, other dynasties were established. The Yufirids established an independent state in San'a in 847 and forced the Ziyadid ruler to tolerate their rule in exchange for mentioning him on coins and in the Friday prayer. An imam of the Shi'ite Zaydiyyah sect, al-Hadi ila'l-Haqq Yahya established a power base in the northern highlands in 897; it was the beginning of the Yemeni imamate that endured until 1962. Furthermore, the late ninth and early tenth centuries saw a great deal of agitation by Ismaili figures who adhered to the Fatimid imam (whose descendants were later to become caliphs in Egypt). Zabid itself was sacked by the sectarian Qarmatians, an Ismaili branch, in 904. Under the lengthy reign of Abu'l-Jaysh Ishaq (r. 904-981), the Ziyadid dynasty experienced a temporary revival. However, when Abu'l-Jaysh grew old the outer regions began to fall away from Ziyadid rule. Towards the end of his reign the area between Aden and ash-Sharjah remained under his control. Even at late as 976, the royal revenues amounted to a million gold dinars.
The Yufirids again attacked in 989 and burnt Zabid. However, the Mamluk al-Husayn bin Salamah managed to save the kingdom from complete collapse. He defeated the mountain tribes and restored the Ziyadid realm to its old limits. Al-Husayn was remembered as a just and high-spirited regent who dug wells and canals and constructed roads across the kingdom. He governed until his peaceful demise in 1012. The back side of the coin was that the Ziyadid monarchs lost effective power after 981 while a succession of Mamluks held real power, which at length made for political turmoil. After al-Husayn's death, his slave, the eunuch Marjan, held power as wazir. He in turn raised two Ethiopian slaves called Nafis and Najah who received high offices in the state. According to Kamal Suleiman Salibi, the last Ziyadi ruler was murdered in 1018 and replaced by Nafis. Nafis adopted royal titles but was immediately challenged by Najah, who defeated Nafis and Marjan and founded the Najahid dynasty in 1022.