The Gujarat Sultanate was a kingdom established in the early 15th century in Gujarat. The founder of the ruling Muzaffarid dynasty, Zafar Khan (later Muzaffar Shah I) was appointed as governor of Gujarat by Nasir-ud-Din Muhammad bin Tughluq IV in 1391, the ruler of the principal state in north India at the time, the Delhi Sultanate. Zafar Khan's father Sadharan, was a Tanka Rajput convert to Islam. Zafar Khan defeated Farhat-ul-Mulk near Anhilwada Patan and made the city his capital. He declared himself independent in 1407. The next sultan, his grandson Ahmad Shah I founded the new capital Ahmedabad in 1411 on the banks of Sabarmati River, which he styled as Shahr-i-Mu'azzam (the great city). The prosperity of the sultanate reached its zenith during the rule of Mahmud Shah I Begada. In 1509, the Portuguese wrested Diu from Gujarat sultanate following the Battle of Diu (1509). Mughal emperor Humayun attacked Gujarat in 1535. The end of the sultanate came in 1573, when Akbar annexed Gujarat in his empire. Gujarat became a Mughal Subah. The last ruler Muzaffar Shah III was taken prisoner to Agra. In 1583, he escaped from the prison and with the help of the nobles succeeded to regain the throne for a short period before being defeated by Akbar's general Abdul Rahim Khan-I-Khana.
During the rule of Muhammad bin Tughluq, his cousin Firuz Shah Tughlaq was once on a hunting expedition in area what is now Kheda district of Gujarat. He lost his way and lost. He reached village Thasra. He was welcome to partake in hospitality by village headmen, two brothers of Tanka Rajput family, Sadhu and Sadharan. After drinking, he revealed his identity as a cousin and successor of the king. The brothers offered his beautiful sister in marriage and he accepted. They accompanied Firuz Shah Tughluq to Delhi along with his sister. They converted to Islam there. Sadhu assumed new name, Samsher Khan while Sadharan assumed Wajih-ul-Mulk. They were disciple of saint Hazrat-Makhdum-Sayyid-i-Jahaniyan-Jahangshi aka Saiyyd Jalaluddin Bukhari.
Delhi Sultan Firuz Shah Tughluq appointed Malik Mufarrah, also known as Farhat-ul-Mulk and Rasti Khan governor of Gujarat in 1377. In 1387, Sikandar Khan was sent to replace him, but he was defeated and killed by Farhat-ul-Mulk. In 1391, Sultan Nasir-ud-Din Muhammad bin Tughluq appointed Zafar Khan, the son of Wajih-ul-Mulk as governor of Gujarat and conferred him the title of Muzaffar Khan. In 1392, he defeated Farhat-ul-Mulk in the battle of Kamboi, near Anhilwada Patan and occupied the city of Anhilwada Patan.
In 1403, Zafar Khan's son Tatar Khan urged his father to march on Delhi, which he declined. As a result, in 1408, Tatar imprisoned him in Ashawal (future Ahmedabad) and declared himself sultan under the title of Muhammad Shah. He marched towards Delhi, but on the way he was poisoned by his uncle, Shams Khan. After the death of Muhammad Shah, Muzaffar was released from the prison and he took over the control over administration. In 1407, he declared himself as Sultan Muzaffar Shah, took the insignia of royalty and issued coins in his name. After his death in 1411, he was succeeded by his grandson, the son of Tatar Khan, Ahmad Shah.
Soon after his accession, Ahmad Shah was faced with a rebellion of his uncles. The rebellion was led by his eldest uncle Firuz Khan, who declared himself king. Ultimately Firuz and his brothers surrendered to him. During this rebellion Sultan Hoshang Shah of Malwa invaded Gujarat. He was repelled this time but he invaded again in 1417 along with Nasir Khan, the Faruqi dynasty ruler of Khandesh and occupied Sultanpur and Nandurbar. Gujarat army defeated them and later Ahmad Shah led four expeditions into Malwa in 1419, 1420, 1422 and 1438.
In 1429, Kanha Raja of Jhalawar with the help of the Bahmani Sultan Ahmad Shah ravaged Nandurbar. But Ahmad Shah's army defeated the Bahmani army and they fled to Daulatabad. The Bahmani Sultan Ahmad Shah sent strong reinforcements and the Khandesh army also joined them. They were again defeated by the Gujarat army. Finally, Ahmad Shah annexed Thana and Mahim from Bahmani kingdom.
At the beginning of his reign, he founded the city of Ahmadabad, where he shifted the capital from Anhilwada Patan. The Jami Masjid (1423) and the Teen Darwaza in Ahmedabad were built during his reign.
Sultan Ahmad Shah died in 1443 and succeeded by his eldest son Muizz-ud-Din Muhammad Shah.
Muhammad Shah first led a campaign against Idar and forced its ruler, Raja Hari Rai or Bir Rai to submit to his authority. He then exacted tribute from the Rawal of Dungarpur. In 1449, he marched against Champaner, but the ruler of Champaner, Raja Kanak Das, with the help of Malwa Sultan Mahmud Shah Khilji forced him to retreat. On the return journey, he fell seriously ill and died in February, 1451. After his death, he was succeeded by his son Qutb-ud-Din Ahmad Shah II.
After the death of Qutb-ud-Din Ahmad Shah II in 1458, the nobles raised his uncle Daud Khan to the throne. But within a short period of seven or twenty-seven days the nobles deposed him and set on the throne Fath Khan, son of Muhammad Shah II. Fath Khan, on his accession, adopted the title Abu-al Fath Mahmud Shah but he was popularly known as Mahmud Begadha. He received the sobriquet Begarha, which literally means conqueror of two forts, probably after conquering Girnar and Champaner forts. Mahmud died on 23 November 1511.
Khalil Khan, son of Mahmud Beghara succeeded his father with the title Mazaffar Shah. In 1519, Rana Sanga defeated a joint army of Malwa and Gujarat sultanates and took Mahmud Shah II of Malwa captive. Muzaffar Shah sent an army to Malwa but their service was not required as Rana Sanga had generously restored Mahmud II to the throne. Rana Sanga later invaded Gujarat and plundered the Sultanate's treasuries, greatly damaging its prestige. He died on 5 April 1526 and was succeeded by his eldest son, Sikandar.
The end of the sultanate came in 1573, when Akbar annexed Gujarat in his empire. Gujarat became a Mughal Subah. The last ruler Muzaffar Shah III was taken prisoner to Agra. In 1583, he escaped from the prison and with the help of the nobles succeeded to regain the throne for a short period before being defeated by Akbar's general Abdul Rahim Khan-I-Khana in January 1584. He fled and finally took asylum under Jam Sataji of Nawanagar State. The Battle of Bhuchar Mori was fought between the Mughal forces led by Mirza Aziz Koka and the combined Kathiawar forces in 1591 to protect him. He finally committed suicide when he was surrendered to the Mughal.