Ibn Battuta was born in Tangier in 1304 to a family of Islamic legal scholars, and in 1325, at twenty one, he set out alone for the hajj to Mecca, the standard pious journey of any young Muslim scholar of means. What began as a single pilgrimage became, almost by accident of temperament, a career of nearly continuous travel: rather than returning home after reaching Mecca, Ibn Battuta kept moving, first through Persia and Iraq, then down the East African coast to Kilwa, then across Anatolia, the Central Asian steppe and Persia again toward India, arriving eventually at the court of the Delhi Sultanate, where the sultan Muhammad bin Tughluq, impressed by his legal training, appointed him a qadi, an Islamic judge.
From Delhi his travels only widened further: a diplomatic mission sent him toward China by way of the Maldives, where he served briefly as a judge and married into the island nobility, and by Sumatra, and he is generally credited with having reached the Chinese coast, though the surviving text is vaguest and most debated in this final stretch. He eventually returned to Morocco in 1349, made further journeys to Muslim Spain and across the Sahara to the Mali Empire, and finally settled, at the command of the Marinid sultan Abu Inan, to dictate the full account of some twenty nine years of travel to the court scholar Ibn Juzayy, completed in 1355. He died in Morocco around 1368 or 1369, a career mostly forgotten in the Islamic world itself until later Ottoman era manuscript copies preserved his account for modern scholarship to rediscover.