the time was ruled by the autonomous Tulunid dynasty. Sa'id arrived in Fustat, the capital of Egypt, in early 904, and settled there in the house of a local convert, with the help of the local , Abu Ali. According to the—generally considered reliable—report of Ibn Hawqal, the latter was none other than Hamdan Qarmat, who had returned to Sa'id's allegiance. Sa'id assumed the identity of a wealthy Hashemite merchant, but local authorities, warned by Baghdad, became suspicious. The loyal eunuch Ja'far was even questioned under torture, but revealed nothing. Sa'id remained in Fustat until January 905, when the Abbasid troops under Muhammad ibn Sulayman al-Katib invaded Egypt and ended the Tulunid regime, bringing the province once again directly under Abbasid control. To escape the Abbasids, Sa'id was once again forced to flee. His entourage apparently expected him to head to Yemen, where the missionaries Ibn Hawshab and Ibn al-Fadl had conquered most of the country in the name of the Ima'ili imam. Instead, Sa'id resolved to turn west to the Maghreb, much to the surprise and dismay of his followers: while Yemen was part of the civilized Arab world, the Maghreb was wild and uncultured, far from the centres of the Islamic world, politically fractured, and dominated by Berber tribes. Indeed, the chief missionary Fayruz abandoned his master and made for Yemen on his own. The reason for Sa'id's choice is unknown, but the historian Wilferd Madelung suggests that he had doubts about Ibn al-Fadl's loyalty; the latter would indeed eventually renounce his allegiance and declare himself to be the awaited . At the same time, however, the situation in the Maghreb was promising. The Abu Abdallah al-Shi'i had converted the Kutama Berbers to his cause, and by 905 had achieved some first victories against the autonomous Aghlabid dynasty that ruled Ifriqiya (modern Tunisia and eastern Algeria) under nominal Abbasid suzerainty. Sending the trustworthy Ja'far back to Salamiya to dig up the treasures hidden there, Sa'id joined a merchant caravan going west. On the way, the caravan was attacked by Berber tribes, which left his companion Abu'l-Abbas Muhammad wounded, and his library and many of his possessions in the hands of their attackers. The party made a stop at Tripoli, where they waited for Ja'far to join them with the recovered treasure. In the meantime, Abu'l-Abbas Muhammad was sent ahead to Kairouan, the Aghlabid capital. Unbeknownst to him, news