Ibn al-Faqih (writing c. 903) mentions a caravan route from Egypt to ancient Ghana via Kawkaw, but Ibn Hawqal (writing c. 988) states that the old route from Egypt to the Sudan was abandoned in the reign of the Egyptian ruler Ibn Tulun (ruled 868–884) as some of the caravans were attacked by bandits while others were overwhelmed by the wind-blown sand. The more direct route was replaced by one that went to Sijilmasa before heading south across the Sahara. In the 10th century, Gao is already Muslim and is described as consisting of two separate towns. Al-Muhallabi, who died in 990, wrote in a lost work quoted in the biographical dictionary compiled by Yaqut: