The Saffarid dynasty (safaryan) was a Persianate dynasty of eastern Iranian origin that ruled over parts of Persia, Greater Khorasan, and eastern Makran from 861 to 1003. One of the first indigenous Persian dynasties to emerge after the Islamic conquest, the Saffarid dynasty was part of the Iranian Intermezzo. The dynasty's founder was Ya'qub bin Laith as-Saffar, who was born in 840 in a small town called Karnin (Qarnin), which was located east of Zaranj and west of Bost, in what is now Afghanistan. A native of Sistan and a local ayyār, Ya'qub worked as a coppersmith (ṣaffār) before becoming a warlord. He seized control of the Sistan region and began conquering most of Iran and Afghanistan, as well as parts of Pakistan, Tajikistan and Uzbekistan.
The Saffarids used their capital Zaranj as a base for an aggressive expansion eastward and westward. They first invaded the areas south of the Hindu Kush, and then overthrew the Tahirid dynasty, annexing Khorasan in 873. By the time of Ya'qub's death, he had conquered the Kabul Valley, Sindh, Tocharistan, Makran (Balochistan), Kerman, Fars, Khorasan, and nearly reached Baghdad but then suffered a defeat by the Abbasids.
The Saffarid dynasty did not last long after Ya'qub's death. His brother and successor, Amr bin Laith, was defeated at the Battle of Balkh against Ismail Samani in 900. Amr bin Laith was forced to surrender most of his territories to the new rulers. The Saffarids were confined to their heartland of Sistan, and with time, their role was reduced to that of vassals of the Samanids and their successors.
The dynasty began with Ya'qub ibn al-Layth al-Saffar (Ya'qub, son of Layth, the Coppersmith), a coppersmith of eastern Iranian origins, who moved to the city of Zaranj. He left work to become an Ayyar and eventually got the power to act as an independent ruler. From his capital Zaranj he moved east into al-Rukhkhadj (Arachosia), Zamindawar and ultimately Kabul, vanquishing the Zunbils and the Hindu Shahis by 865. He then invaded Bamyan, Balkh, Badghis, and Ghor.