structural:scholar_edition
Indian subcontinent

Muhammad bin Tughluq was renowned as the wealthiest man in the Muslim world at that time. He patronized various scholars, Sufis, qadis, viziers, and other functionaries in order to consolidate his rule. On the strength of his years of study in Mecca, Ibn Battuta was appointed a qadi, or judge, by the sultan. However, he found it difficult to enforce Islamic law beyond the sultan's court in Delhi, due to lack of Islamic appeal in India.

It is uncertain by which route Ibn Battuta entered the Indian subcontinent but it is known that he was kidnapped and robbed by rebels on his journey to the Indian coast. He may have entered via the Khyber Pass and Peshawar, or further south. He crossed the Sutlej river near the city of Pakpattan, in modern-day Pakistan, where he paid obeisance at the shrine of Baba Farid, before crossing southwest into Rajput country. From the Rajput kingdom of Sarsatti, Battuta visited Hansi in India, describing it as "among the most beautiful cities, the best constructed and the most populated; it is surrounded with a strong wall, and its founder is said to be one of the great non-Muslim kings, called Tara". Upon his arrival in Sindh, Ibn Battuta mentions the Indian rhinoceros that lived on the banks of the Indus.

The Sultan was erratic even by the standards of the time and for six years Ibn Battuta veered between living the high life of a trusted subordinate and falling under suspicion of treason for a variety of offences. His plan to leave on the pretext of taking another hajj was stymied by the Sultan. The opportunity for Battuta to leave Delhi finally arose in 1341 when an embassy arrived from the Yuan dynasty of China asking for permission to rebuild a Himalayan Buddhist temple popular with Chinese pilgrims.

Ibn Battuta was given charge of the embassy but en route to the coast at the start of the journey to China, he and his large retinue were attacked by a group of bandits. Separated from his companions, he was robbed, kidnapped, and nearly lost his life. Despite this setback, within ten days he had caught up with his group and continued on to Khambhat in the Indian state of Gujarat. From there, they sailed to Calicut (now known as Kozhikode), where Portuguese explorer Vasco da Gama would land two centuries later. While in Calicut, Battuta was the guest of the ruling Zamorin. While Ibn Battuta visited a mosque on shore, a storm arose and one of the ships of his expedition sank. The other ship then sailed without him only to be seized by a local Sumatran king a few months later.

Afraid to return to Delhi and be seen as a failure, he stayed for a time in southern India under the protection of Jamal-ud-Din, ruler of the small but powerful Nawayath Sultanate on the banks of the Sharavathi river next to the Arabian Sea. This area is today known as Hosapattana and lies in the Honnavar Taluk of Uttara Kannada. Following the overthrow of the sultanate, Ibn Battuta had no choice but to leave India. Although determined to continue his journey to China, he first took a detour to visit the Maldive Islands where he worked as a judge.

He spent nine months on the islands, much longer than he had intended. When he arrived at the capital, Malé, Ibn Battuta did not plan to stay. However, the leaders of the formerly Buddhist nation that had recently converted to Islam were looking for a chief judge, someone who knew Arabic and the Qur'an. To convince him to stay they gave him pearls, gold jewellery, and slaves, while at the same time making it impossible for him to leave by ship. Compelled into staying, he became a chief judge and married into the royal family of Omar I.

Ibn Battuta took on his duties as a judge with keenness and strived to transform local practices to conform to a stricter application of Muslim law. He commanded that men who did not attend Friday prayer be publicly whipped, and that robbers' right hand be cut off. He forbade women from being topless in public, which had previously been the custom. However, these and other strict judgments began to antagonize the island nation's rulers, and involved him in power struggles and political intrigues. Ibn Battuta resigned from his job as chief qadi, although in all likelihood it was inevitable that he would have been dismissed.

Throughout his travels, Ibn Battuta kept close company with women, usually taking a wife whenever he stopped for any length of time at one place, and then divorcing her when he moved on. While in the Maldives, Ibn Battuta took four wives. In his Travels he wrote that in the Maldives the effect of small dowries and female non-mobility combined to, in effect, make a marriage a convenient temporary arrangement for visiting male travellers and sailors.

From the Maldives, he carried on to Sri Lanka and visited Sri Pada and Tenavaram temple. Ibn Battuta's ship almost sank on embarking from Sri Lanka, only for the vessel that came to his rescue to suffer an attack by pirates. Stranded onshore, he worked his way back to the Madurai kingdom in India. Here he spent some time in the court of the short-lived Madurai Sultanate under Ghiyas-ud-Din Muhammad Damghani, from where he returned to the Maldives and boarded a Chinese junk, still intending to reach China and take up his ambassadorial post.

He reached the port of Chittagong in modern-day Bangladesh intending to travel to Sylhet to meet Shah Jalal, who became so renowned that Ibn Battuta, then in Chittagong, made a one-month journey through the mountains of Kamaru near Sylhet to meet him. On his way to Sylhet, Ibn Battuta was greeted by several of Shah Jalal's disciples who had come to assist him on his journey many days before he had arrived. At the meeting in 1345 CE, Ibn Battuta noted that Shah Jalal was tall and lean, fair in complexion and lived by the mosque in a cave, where his only item of value was a goat he kept for milk, butter, and yogurt. He observed that the companions of the Shah Jalal were foreign and known for their strength and bravery. He also mentions that many people would visit the Shah to seek guidance. Ibn Battuta went further north into Assam, then turned around and continued with his original plan.