The Sajid dynasty 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. The Sajids originated from the Central Asian province of Ushrusana and were of Iranian (Sogdian) 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 neighbouring Armenia. The dynasty ended with the death of Abu’l-Musafir al-Fath in 929.