When Basra was attacked by the Zanj and Ar-Riāshī murdered in 871 he fled to Oman,[1][2] then ruled by Muhallabi.[3] He is said to have practiced as a physician although no works on medical science by him are known to survive.[4][13] After twelve years Khallikan says he returned to Basra for a time and then moved to Persia[2] In Al-Nadim's account he moved to Jazīrat Ibn ‘Umārah (this may refer to the Baṣra suburb) before he moved to Persia[6] where he was under the protection of the governor Abd-Allah Mikali and his sons, and where he wrote his chief works.[1] Abd-Allah appointed him director of the government office for Fars Province and it is said while there each time his salary was paid he donated almost it all to the poor.[2] In 920 he moved to Baghdad,[9][2] and received a monthly pension of fifty dinars from the caliph Al-Muqtadir[1] in support of his literary activities which continued to his death.[2] In Baghdad he became an acquaintance of Muhammad ibn Jarir al-Tabari.[14]