Muslim rule
Islamic conquests, 1197–1614
After the Ghoris had assumed a position of Muslim supremacy over North India, Qutbuddin Aibak attempted to conquer Gujarat and annex it to his empire in 1197, but failed in his ambitions. An independent Muslim community continued to flourish in Gujarat for the next hundred years, championed by Arab merchants settling along the western coast. From 1297 to 1300, Alauddin Khalji, the Turko-Afghan Sultan of Delhi, destroyed the Hindu metropolis of Anhilwara and incorporated Gujarat into the Delhi Sultanate.
After Timur sacked Delhi at the end of the 14th century, weakening the Sultanate, Gujarat's Muslim Khatri governor Zafar Khan Muzaffar (Muzaffar Shah I) asserted his independence, and his son, Sultan Ahmed Shah (ruled 1411–1442), established Ahmedabad as the capital. Khambhat eclipsed Bharuch as Gujarat's most important trade port. Gujarat's relations with Egypt, which was then the premier Arab power in the Middle East, remained friendly over the next century and the Egyptian scholar, Badruddin-ad-Damamimi, spent several years in Gujarat in the shade of the Sultan before proceeding to the Bahmani Sultanate on the Deccan Plateau.
Shah e Alam, a famous Sufi saint of the Chishti order who was the descendant of Makhdoom Jahaniyan Jahangasht from Bukhara, soon arrived in a group that included Arab theologian Ibn Suwaid, several Sayyid Sufi members of the Aydarus family of Tarim in Yemen, Iberian court interpreter Ali al-Andalusi from Granada, and the Arab jurist Bahraq from Hadramaut who was appointed a tutor of the prince. Among the illustrious names who arrived during the reign of Mahmud Begada was the philosopher Haibatullah Shah Mir from Shiraz, and the scholar intellectual Abu Fazl Ghazaruni from Persia who tutored and adopted Abu'l-Fazl ibn Mubarak, author of the Akbarnama. Later, a close alliance between the Ottoman Turks and Gujarati sultans to effectively safeguard Jeddah and the Red Sea trade from Portuguese imperialism, encouraged the existence of powerful Rumi elites within the kingdom who took the post of viziers in Gujarat keen to maintain ties with the Ottoman state.
Humayun also briefly occupied the province in 1536, but fled due to the threat Bahadur Shah, the Gujarat king, imposed. The Sultanate of Gujarat remained independent until 1572, when the Mughal emperor Akbar conquered it and annexed it to the Mughal Empire.
The Surat port (the only Indian port facing west) then became the principal port of India during Mughal rule, gaining widespread international repute. The city of Surat, famous for its exports of silk and diamonds, had reached a par with contemporary Venice and Beijing, great mercantile cities of Europe and Asia, and earned the distinguished title, Bab al-Makkah (Gate of Mecca).
Drawn by the religious renaissance taking place under Akbar, Mohammed Ghaus moved to Gujarat and established spiritual centers for the Shattari Sufi order from Iran, founding the Ek Toda Mosque and producing such devotees as Wajihuddin Alvi of Ahmedabad whose many successors moved to Bijapur during the height of the Adil Shahi dynasty. At the same time, Zoroastrian high priest Azar Kayvan who was a native of Fars, immigrated to Gujarat founding the Zoroastrian school of illuminationists which attracted key Shi'ite Muslim admirers of the Safavid philosophical revival from Isfahan.
Early 14th-century Maghrebi adventurer, Ibn Batuta, who famously visited India with his entourage, recalls in his memoirs about Cambay, one of the great emporia of the Indian Ocean that indeed:
Cambay is one of the most beautiful cities as regards the artistic architecture of its houses and the construction of its mosques. The reason is that the majority of its inhabitants are foreign merchants, who continually build their beautiful houses and wonderful mosques – an achievement in which they endeavor to surpass each other.
Many of these "foreign merchants" were transient visitors, men of South Arabian and Persian Gulf ports, who migrated in and out of Cambay with the rhythm of the monsoons. But others were men with Arab or Persian patronyms whose families had settled in the town generations, even centuries earlier, intermarrying with Gujarati women, and assimilating everyday customs of the Hindu hinterland.
The Age of Discovery heralded the dawn of pioneer Portuguese and Spanish long-distance travel in search of alternative trade routes to "the East Indies", moved by the trade of gold, silver and spices. In 1497, Portuguese explorer Vasco da Gama is said to have discovered the Europe-to-India sea route which changed the course of history, thanks to Kutchi sailor Kanji Malam, who showed him the route from the East African coasts of Mozambique sailing onwards to Calicut off the Malabar coast in India. Later, the Gujarat Sultanate allied with the Ottomans and Egyptian Mamluks naval fleets led by governor-generals Malik Ayyaz and Amir Husain Al-Kurdi, vanquished the Portuguese in the 1508 Battle of Chaul resulting in the first Portuguese defeat at sea in the Indian Ocean.
To 16th-century European observers, Gujarat was a fabulously wealthy country. The customs revenue of Gujarat alone in the early 1570s was nearly three times the total revenue of the whole Portuguese empire in Asia in 1586–87, when it was at its height. Indeed, when the British arrived on the coast of Gujarat, houses in Surat already had windows of Venetian glass imported from Constantinople through the Ottoman Empire. In 1514, the Portuguese explorer Duarte Barbosa described the cosmopolitan atmosphere of Rander known otherwise as City of Mosques in Surat province, which gained the fame and reputation of illustrious Islamic scholars, Sufi-saints, merchants and intellectuals from all over the world:
Ranel (Rander) is a good town of the Moors, built of very pretty houses and squares. It is a rich and agreeable place ... the Moors of the town trade with Malacca, Bengal, Tawasery (Tannasserim), Pegu, Martaban, and Sumatra in all sort of spices, drugs, silks, musk, benzoin and porcelain. They possess very large and fine ships and those who wish Chinese articles will find them there very completely. The Moors of this place are white and well dressed and very rich they have pretty wives, and in the furniture of these houses have china vases of many kinds, kept in glass cupboards well arranged. Their women are not secluded like other Moors, but go about the city in the day time, attending to their business with their faces uncovered as in other parts.
The conquest of the Kingdom of Gujarat marked a significant event of Akbar's reign. Being the major trade gateway and departure harbour of pilgrim ships to Mecca, it gave the Mughal Empire free access to the Arabian Sea and control over the rich commerce that passed through its ports. The territory and income of the empire were vastly increased.