He was in Baghdad at least until the end of September 942, as recorded in notes in his Mabādeʾ ārāʾ ahl al-madīna al-fāżela. He finished the book in Damascus the following year (331), i.e., by September 943). He also lived and taught for some time in Aleppo. Al-Farabi later visited Egypt, finishing six sections summarizing the book Mabādeʾ, in Egypt in 337/July 948 – June 949 when he returned to Syria, where he was supported by Sayf al-Dawla, the Hamdanid ruler. Al-Mas'udi, writing barely five years after the fact (955-6, the date of the composition of the Tanbīh), says that al-Farabi died in Damascus in Rajab 339 (between 14 December 950 and 12 January 951).