 When Seville came into the hands of Ferdinand III of Castile in 1248, Ibn Sahl left for Ceuta, where he became the secretary of the Almohad governor Abu Ali Ibn Khallas.When Ibn Khallas sent his son to al-Mustanir I, the caliph of the Hafsids of Ifriqiya, he decided to send Ibn Sahl with him.The galley with which they travelled was shipwrecked and all the passengers perished.