11th/12th century, Makuria's capital Dongola was in decline, and Alodia's capital declined in the 12th century as well. In the 14th and 15th centuries Bedouin tribes overran most of Sudan, migrating to the Butana, the Gezira, Kordofan and Darfur. In 1365 a civil war forced the Makurian court to flee to Gebel Adda in Lower Nubia, while Dongola was destroyed and left to the Arabs. Afterwards Makuria continued to exist only as a petty kingdom. After the prosperous reign of king Joel ( 1463–1484) Makuria collapsed. Coastal areas from southern Sudan up to the port city of Suakin was succeeded by the Adal Sultanate in the fifteenth century. To the south, the kingdom of Alodia fell to either the Arabs, commanded by tribal leader Abdallah Jamma, or the Funj, an African people originating from the south. Datings range from the 9th century after the Hijra ( 1396–1494), the late 15th century, 1504 to 1509. An alodian rump state might have survived in the form of the kingdom of Fazughli, lasting until 1685. Islamic kingdoms of Sennar and Darfur (c. 1500–1821) In 1504 the Funj are recorded to have founded the Kingdom of Sennar, in which Abdallah Jamma's realm was incorporated. By 1523, when Jewish traveler David Reubeni visited Sudan, the Funj state already extended as far north as Dongola. Meanwhile, Islam began to be preached on the Nile by Sufi holymen who settled there in the 15th and 16th centuries and by David Reubeni's visit king Amara Dunqas, previously a Pagan or nominal Christian, was recorded to be Muslim. However, the Funj would retain un-Islamic customs like the divine kingship or the consumption of alcohol until the 18th century. Sudanese folk Islam preserved many rituals stemming from Christian traditions until the recent past. Soon the Funj came in conflict with the Ottomans, who had occupied Suakin around 1526 and eventually pushed south along the Nile, reaching the third Nile cataract area in 1583/1584. A subsequent Ottoman attempt to capture Dongola was repelled by the Funj in 1585. Afterwards, Hannik, located just south of the third cataract, would mark the border between the two states. The aftermath of the Ottoman invasion saw the attempted usurpation of Ajib, a minor king of northern Nubia. While the Funj eventually killed him in 1611/1612 his successors, the Abdallab, were granted to govern everything north of the confluence of Blue and White Niles with considerable