Devout Muslims, Africans from countries such as Chad, Sudan, Nigeria and Senegal, trekked across continents to perform the original Muslim pilgrimage of the Haj - first to Mecca, then to al-Aqsa.Such pilgrimages date back to as early as 636 AD, after Omar Ibn Khatab took Jerusalem from the Byzantine Empire. Some arrived, fell in love with the city and decided never to leave.
A variant says that they mostly arrived in the 19th century:
During the Ottoman era, Africans worked as custodians and guards of al-Aqsa Mosque – their role was to prohibit non-Muslims accessing the premises of Al-Haram Al-Sharif, the Noble Sanctuary and third holiest site in Islam. Many of them were Muslim immigrants from Chad, Sudan, Nigeria and Senegal who settled in Jerusalem in the nineteenth century after performing the pilgrimage to Mecca.
Up to 1.3 million slaves from Africa alone are estimated to have been transported to the Ottoman Empire, including Ottoman Egypt and North Africa, during the 19th century.Although trade in slaves was officially forbidden, ownership of slaves was not, and possession and use of slaves continued into the early 20th century. Ottoman officials generally tried to steer a compromise course in order to satisfy the demands of abolitionists and at the same time not to alienate conservative forces within the Empire. Ottoman Egypt made up the lion’s share of slave trade and slave holding, while in the region of Palestine, its direct neighbor, both phenomena were of much smaller proportion.