 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.