After his surrender, he was initially treated with much honour, but Harun remained deeply suspicious of his popularity and intentions, and recalled him to Baghdad, where he spent the remainder of his life in prison.
[2] The change of dynasty was not a mere succession struggle, but the culmination of a broad social and political movement that rejected the Umayyad regime, which was widely regarded as oppressive, too dependent on and favouring its Syrian heartland to the exclusion of other areas, and more concerned with the worldly aspects of the caliphate than the teachings of Islam.
Nevertheless, many Alids, chiefly of the Zaydi and Hasanid (to which Yahya belonged) branches, continued to reject the Abbasids as usurpers, and several went into hiding and once again tried to rouse the discontented against the new regime.
[7] Yahya was too young to take part in the uprising,[1] but, along with his brother Idris, he played a prominent role in the revolt of his nephew, al-Husayn ibn Ali al-Abid, that ended at the Battle of Fakhkh, near Mecca, in 786.
[1] Following the defeat of the Alids and their supporters, Yahya, Idris, and a few others were sheltered by a Khuza'i tribesman, who helped them flee Arabia to the Kingdom of Aksum (in modern Ethiopia).
At this meeting, it was decided that the two brothers were to split, each going to a different place in the periphery of the Abbasid empire: Idris went to the Maghreb, where he founded an independent dynasty in what is now Morocco, and Yahya to Yemen.
[1] The Caliph in response entrusted the suppression of the revolt to his trusted aide, the Barmakid al-Fadl ibn Yahya, naming him governor of Tabaristan and the neighbouring provinces, and giving him an army of 50,000 men.
[1] Yahya took precautions against possible treachery by carefully composing the letter of pardon for himself and seventy unnamed followers, had the Caliph himself write it out, and a number of prominent scholars, jurists, and members of the Abbasid dynasty endorse it.
[1] On the other hand, another report that al-Fadl was the one to encourage Yahya to seek refuge in Daylam and rise in revolt, and that his dispatch to suppress it was a test of his loyalty by the Caliph, is rejected by modern historians.
The reasons behind this are unclear, but the Barmakids may possibly have aspired to the Abbasids' establishing a more absolutist and theocratic regime, based on a divine mandate similar to that claimed by the Shi'a for the Alids, and to that advocated half a century later by the Mu'tazilites.
[10] Now free of the Caliph's control, Yahya spent much of the sums he had received to pay the debt of al-Husayn ibn Ali al-Abid, and provide for other Alids who were in need of money.
To prevent any possible Alid uprising led by Yahya, the suspicious Harun al-Rashid appointed Abdallah ibn Mus'ab al-Zubayri (796/97) and soon after his son, Bakkar (797–809), as governors of Medina.
Bakkar especially soon began denouncing Yahya as behaving like another caliph, and sent alarming reports to Harun al-Rashid about the affection and respect he commanded among the common people, who came from afar to visit him.
[12] The brutal manner in which Ja'far was executed, however, is directly linked to his allowing Yahya's escape by Abu Muhammad al-Yazidi, whom the great 10th-century historian al-Tabari held to be the most authoritative source on the Barmakid family.
[9] Following the downfall of the Barmakids, Yahya was given over to al-Sindi ibn Shahak, the security chief (sahib al-shurta) of the capital, who just three years earlier had been responsible for the death of the Twelver imam Musa al-Kazim.