Islam was introduced to the area early on by the first Muslims of Mecca fleeing prosecution during the first Hejira with Masjid al-Qiblatayn in Zeila being built before the Qiblah towards Mecca. It is one of the oldest mosques in Africa. In the late 9th century, Al-Yaqubi wrote that Muslims were living along the northern Somali seaboard. He also mentioned that the Adal Kingdom had its capital in the city. According to Leo Africanus, the Adal Sultanate was governed by local Somali dynasties and its realm encompassed the geographical area between the Bab el Mandeb and Cape Guardafui. It was thus flanked to the south by the Ajuran Empire and to the west by the Abyssinian Empire.