|Muhammad ibn Abi'l-Saj|
|Abu'l-Musafir al-Fath (last)|
|Historical era||Middle Ages|
The Sajid dynasty (Persian: ), was an Iranian Muslim dynasty that ruled from 889-890 until 929. The Sajids ruled Azerbaijan and parts of Armenia first from Maragha and Barda and then from Ardabil.[a] The Sajids originated from the Central Asian province of Ushrusana and were of Iranian (Sogdian)[b] descent. Muhammad ibn Abi'l-Saj Diwdad the son of Diwdad, the first Sajid ruler of Azerbaijan, was appointed as its ruler in 889 or 890. Muhammad's father Abu'l-Saj Devdad had fought under the Ushrusanan prince Afshin Khaydar during the latter's final campaign against the rebel Babak Khorramdin in Azerbaijan, and later served the caliphs. Toward the end of the 9th century, as the central authority of the Abbasid Caliphate weakened, Muhammad was able to form a virtually independent state. Much of the Sajids' energies were spent in attempting to take control of neighboring Armenia. The dynasty ended with the death of Abu'l-Musafir al-Fath in 929.
At the end of the ninth century (898-900) coins were minted named after Muhammad ibn Abu Saj. Muhammad ibn Abu Saj succeeded in incorporating much of the South Caucasus into the Sajid state. The first capital of Sajids was Maragha though they usually resided in Barda.
Yusuf ibn Abi'l-Saj came to power in 901 and demolished the walls of Maragha and moved the capital to Ardabil. The eastern borders of the Sajid dynasty extended to the shores of the Caspian Sea, and the western borders to the cities of Ani and Dabil (Dvin). Yusuf ibn Abi'l-Saj relations with the caliph were not good. In 908, a caliphate army was sent against Yusuf, but al-Muqtafi died and his successor, al-Muqtadir, moved a large army against Yusuf ibn Abi'l-Saj and forced him to pay a tribute of 120 thousand dinars a year. Abu'l-Hasan Ali ibn al-Furat the vizier of al-Muqtadir, played a key role in establishing peace, and since then Yusuf ibn Abi'l-Saj considered him his patron in Baghdad and often mentioned him on his coins. Peace allowed Yusuf ibn Abi'l-Saj to receive investiture of the governorship in Azerbaijan by the caliph in 909.
According to the Azerbaijani historian Abbasgulu aga Bakikhanov, from 908-909 to 919, the Sajids made the Shirvanshah Mazyadids dependent on them. Thus, at the beginning of the X century, the Sajid state included territories from Zanjan in the south to Derbent in the north, the Caspian Sea in the east, to the cities of Ani and Dabil in the west, covering most of the lands of modern Azerbaijan.
During the reign of Yusuf ibn Abi'l-Saj, Russian raiders attacked the Sajid territory from the north via the Volga in 913-914. Yusuf ibn Abu Saj repaired the Derbent wall to strengthen the northern borders of the state. He also rebuilt the collapsed part of the wall inside the sea.
In 914, Yusuf ibn Abi'l-Saj organized a campaign towards Georgia. Tbilisi was chosen as the center of military operations. He first occupied Kakheti and captured the fortresses of Ujarma and Bochorma, and returned after capturing several territories.
After the death of Yusuf ibn Abu Saj, the last ruler of the Sajid dynasty Fath b. Muhammad b. Abi 'l-Saj was poisoned in Ardabil by one of his slaves, which ended the Sajid dynasty and enabled eventual expansion of the Sallarid dynasty into Azerbaijan in 941.