A humble family in Afghanistan gave four sons to the Ayyars, a particularly Persian class of warrior, and one of them rose to become the Emir of Sistan within a fairly short time. This was Yaqub ibn Layth, also known as al-Saffar, so that his dynasty is the Saffarids. Iran was already semi-independent, so at first it didn’t affect Baghdad much. But Yaqub was an energetic conqueror who began re-creating the old Persian kingdom, so the Saffarids became an effective rival.
The Caliph in Baghdad was impressed with Emir Yaqub’s initiative to fight with Kharijites (those Rejectionists who were always bucking authority) in Iran. But Yaqub’s challenge to Baghdad was cultural as well as political, and it began early when he sent a poem in Persian to the Caliph. In his court at Zaranj, he insisted on using the Persian language.
Emir Yaqub conquered more of Afghanistan, finally subduing some Buddhist princes who had held out against Islamic conversion. He took control of a valley where silver is mined and immediately began minting his own coins. Then he conquered the semi-independent rulers in Nishapur, which left him ruling all of Afghanistan and Iran. In the 870s, he pushed his boundaries westward to take the Persian heartland of Fars from Abbasid governors.
Caliph Mutamid led a large army to meet Yaqub’s forces about 50 miles southeast of Baghdad. Here, the Abbasids had the home advantage: they used the Tigris to flood the land behind the Saffarids, cutting off their retreat, in addition to making attacks from boats, which the Persians in this case didn’t have. The Abbasid victory was decisive, but it was not enough to overthrow the Yaqub, only to force him to retreat.
Yaqub died of illness a few years later, and his brother Amr inherited his power. Amr and the next Caliph, Mutadid, negotiated a working partnership. Iran and Afghanistan were too far away for Baghdad to effectively defend them. Abbasids had tried out splitting the territory between brothers, but that didn’t work. Their best solution was to make an alliance with whoever ruled this far-off territory. By 897, Baghdad had formally handed over all of the east to Amr al-Saffari.
A rival Iranian dynasty that managed the Transoxiana region went to war against Amr al-Saffair, and he was captured. In 902, he was executed. This should have been the end of the Saffarids, but it wasn’t. Amr’s grandson had been governing the city of Merv, and he moved to take power. He ruled with the help of his brother, but it was always a fight against the rival dynasty, the Samanids. This is how it went on until 913, when the Samanids took over.
By 922, however, another generation of Saffarid descendants was back in power in Zaranj. Two rulers, Ahmad and his son Khalaf, ruled Iran until 1002, when a new dynasty took over. But no matter the dynasty—Samanid, Saffarid, or Ghaznid—Iran and Afghanistan remained essentially independent of Baghdad permanently. Arabic language became an academic study, as it still is, not an active language of government.