لما توفي تميم بن المعز بويع لابنه يحيى وكان ذا رياسة وسياسة قمع الثوار ومهد النواحي وغزا بأسطوله الروم حتى وقع صلح على شروطه وكان رحيما بالضعفاء مطالعا لكتب السير وأخبار الزمان عارفا بالنجوم والطب وبنظم الشعر الجيد ويجيز عليه ومن شعرائه وجلسائه العلامة الأديب المؤرخ الأريب أبو الصلت أمية بن عبد العزيز الآتي ذكره في الخاتمة وكان له شعر رائق ونثر فائق ويأتي خبره وخبر بعض ملوك صنهاجة في الخاتمة. وفي أيام هذا الأمير دخل محمد بن تومرت مؤسس الدولة الموحدية المهدية في أيام أبي الحسن علي وتقدم بعض خبره بما يفيد أنه دخل المهدية مرتين حين ذهب للمشرق وحين رجع منه انظر ترجمة أبي بكر بن العربي في الطبقة الحادية عشر من المقصد، وتوفي الأمير يحيى في ذي الحجة سنة 509 ه وخلف من البنين ثلاثين ومن البنات عشرين ودفن بقصره على ما جرت به العادة ثم نقل للمنستير.
When Tamim ibn al-Muʿizz died, allegiance was given to his son Yahya. He was a man of leadership and statecraft; he suppressed the rebels, pacified the regions and raided the Byzantines with his fleet until a peace was concluded on his terms. He was merciful to the weak, a reader of the books of history and the reports of the ages, knowledgeable in astrology and medicine and in composing good poetry, and he gave rewards for it. Among his poets and companions was the learned man of letters, the shrewd historian Abu l-Salt Umayya ibn ʿAbd al-ʿAziz, mentioned below in the Conclusion; he had elegant poetry and excellent prose, and his story and the story of some of the kings of Sanhaja will come in the Conclusion. In the days of this emir Muhammad ibn Tumart, the founder of the Almohad dynasty, entered al-Mahdiyya, in the days of Abu l-Hasan ʿAli; some of his story has already been given, showing that he entered al-Mahdiyya twice, when he went to the East and when he returned from it: see the biography of Abu Bakr ibn al-ʿArabi in the eleventh generation of the Maqsad. The emir Yahya died in Dhu l-Hijja of the year 509 AH, leaving thirty sons and twenty daughters. He was buried in his palace, as the custom was, and then carried to al-Munastir.