Muhammad ibn Abi'l-Saj

Muhammad ibn Abi'l-Saj, also known as Muhammad al-Afshin (died 901), an Iranian appointed general of al-Mu'tadid, was the first Sajid amir of Azerbaijan, from 889 or 890 until his death. He was the son of Abi'l-Saj Devdad.

Early career
Like their father, Muhammad and his brother Yusuf had long and active careers. In 879 Muhammad was appointed by the Saffarid Amr bin Laith as his representative in Mecca. When the amir of Egypt Ahmad ibn Tulun died, Muhammad took a leading role in a plot to seize the province from the amir's son Khumarawaih. Despite receiving Abbasid support, however, the plan ultimately failed due both to defeat at the hands of the Tulunids and infighting between the campaign's leaders.

In 889 or 890 Caliph al-Mu'tamid's brother and regent, al-Muwaffaq, appointed Muhammad as governor of Azerbaijan. His first challenge came in the form of 'Abd-Allah b. al-Hasan b. al-Hamdani, a rebel who had taken control of Maragha. Muhammad convinced him to surrender in 893 by promising his safety, but once 'Abd-Allah did so he was executed by the Sajid. Maragha was afterwards made Muhammad's capital, though he usually resided in Bardaa.

Conflict over Armenia
When the Bagratid Smbat I came to the throne of Armenia in 890, Muhammad had sent him a crown and presents in the name of the caliph, asserting his own authority over Smbat in the process. When Smbat sent envoys to the Byzantine emperor in 892, Muhammad threatened to attack him, but Smbat managed to convince the Sajid not to carry out his threat through diplomatic means. Three years later, however, the Bagratid invaded Georgia and Albania. In response Muhammad seized Nakhchivan and Dvin, but was then defeated and decided to make peace.

At some point in his career Muhammad decided to assert his independence from the caliph, probably by refusing to send the revenue due to Baghdad. In 898 he assumed the title al-Afshin, the title previously used by the rulers of Ushrusana in Transoxiana (Muhammad's family was originally from that province). Soon afterwards he decided to restore his loyalty to the caliph, and was confirmed as governor of Azerbaijan and Armenia.

Muhammad launched another campaign against Smbat, taking Kars and capturing Smbat's wife and part of his treasury. Dvin was furthermore brought under control. In 899 Muhammad exchanged Smbat's wife for his son Ashot. Shortly after this he forced the Artsrunid ruler of Vaspurakan, Ashot-Sargis Artsruni, to submit to his authority. In the meantime his loyalty to the caliph again became uncertain. In 900 he invaded Vaspurakan again after Ashot-Sargis's brother, whom Muhammad had taken as a hostage the last time he had invaded, escaped. He left a garrison in Vaspurakan after Ashot-Sargis fled and returned to Bardaa. While preparing another campaign against Smbat, he died of an epidemic in 901. He was succeeded by his son Devdad.