On 5 September 1798 he joined a caravan returning to the Maghreb from Mecca, attaching himself to a party of Fezzan merchants who accompanied the pilgrims. As an avowed Christian would not have been permitted to join the caravan Hornemann assumed the character of a young mamluk trading to Fezzan. He then spoke, but indifferently, both Arabic and Turkish, and he was accompanied as servant and interpreter by Joseph Freudenburg, a German convert to Islam, who had thrice made the pilgrimage to Mecca.