There are often the great masters and scientists of the time, like Mohamed Ibn Ja'far al- Kazzaz Temimī and Abū Isḥāq Ibrahīm al-Ḥuṣari, and deepen his knowledge with them.
In 1026, he contacted the Zirid court by eulogizing the ruler of Al-Muʿizz ben Badis who appreciated the extent of his knowledge and his literary talent.
He quickly became the palace's official poet, while expanding his area of interest in the history of literature and developing his skills in criticism and poetic art theory.
In 1051, he composed the satire of the judge of the city of Sabra (also called El Mansouria), which was deemed worthy to be exiled; he fled to Egypt.
Upon his return, he attended the decay of Kairouan caused by the endless struggles that bring Al-Mu'izz ben Badis to settle in Mahdia.