The Mughal Empire's province Gujarat (now in India) was managed by the viceroys appointed by the emperors. The emperor Farrukhsiyar was deposed by influential Sayad brothers in 1719. He was succeeded by the short reigns of Rafi ud-Darajat and Shah Jahan II. Finally Muhammad Shah was raised to the throne by them. To make peace with powerful vassal, he appointed Ajítsingh of Márwár as a viceroy. The Maratha incursions continued and Píláji Gáikwár established himself at Songad near southern border of Gujarat. Ajit Singh had appointed Anopsingh Bhandari as his deputy. For helping to depose the influential Sayad brothers, Haidar Kúli Khán was appointed the next viceroy. People discontent with Anopsingh rejoiced his appointment but he tried to make himself free so he was recalled. Nizám-ul-Mulk took over who had to face the Maratha incursion again. The Marathas taking advantage of weakening Mughal Empire started extracting tribute from Gujarat regularly. The next viceroy Sarbuland Khan came in conflict with the Marathas whose generals were first defeated at Kapadvanj and again at Aras. The infighting in Marathas later stalled their advances. The imperial troops was sent by the emperor to help. Finally the Marathas were defeated at Sojitra and Kapadvanj and pushed back from their inroads in Gujarat. In subsequent years, the Marathas attacked Vadnagar and later captured Baroda, Dabhoi and Champaner. The growing power of Marathas in the southern Gujarat can not be contained.

In 1730, Abheysingh was appointed as the viceroy who defeated Mubáriz-ul-Mulk at Adalaj who has opposed his appointment. He soon allied with Maratha Peshwa and defeated another Maratha Gaikwar. He returned to Marwar placing Ratansingh Bhandari, his deputy, in charge. He recovered Baroda but his rivalry with other Mughal leaders Momin Khan and Sohrab Khan weaken him. Soon Momin Khan was appointed as the viceroy but he had to laid siege of Ahmedabad to be in power as Ratansingh had not complied with the order. Soon the emperor reappointed Abheysingh but Momin Khan continued siege. He took help of Damaji Gaikwar and finally captured Ahmedabad. He had to share revenues with Gaikwars but soon disagreements rose and they had fights. He tried to manage his control over Gujarat but the Marathas keep growing and expanding their power. After death of Momin Khan, Fidá-ud-dín managed the province foe a while. Abdúl Ázíz Khán, the commander of Junnar near Pune came to power due to forged order but later had to relinquish. Muftakhir Khán, son of Momin Khan, appointed as the next viceroy. During his reign, the Marathas came to Ahmedabad and continued to attack towns in central Gujarat. Fakhr-ud-daulah succeeded him. He had some peace due to internal struggles between the different houses of the Marathas had slow down their advances in Gujarat. In 1748, Muhammad Shah died and he was succeeded by his son Ahmad Shah Bahadur.

Viceroys under Muhammad Shah (1719–1748) Early in 1719, the emperor Farrukhsiyar was deposed and put to death by his nobles the Sayads; and a prince named Rafi ud-Darajat, a grandson of the emperor, was raised to the throne. Rafi ud-Darajat was put to death by the Sayads after a reign of three months, and his brother Rafi ud-Daulah as Shah Jahan II, who succeeded him, also died after a few days' reign. The Sayads then raised to the throne prince Roshan Akhtar Bahadur with the title of Muhammad Shah.

Mahárája Ajítsingh, Forty-ninth Viceroy, 1719–1721 After the murder of Farrukhsiyar, the most powerful vassal in the neighbourhood of Delhi was Ajítsingh of Márwár. To win him to their side the Sayads granted him the viceroyalty of Gujarát, and Míhr Áli Khán was appointed to act for him until his arrival, while Muhammad Bahádur Bábi, son of Salábat Muhammad Khán Bábi, was placed in charge of the police of the district immediately round Áhmedábád. Shortly after, through the influence of the Mahárája Ajítsingh, Náhir Khán superseded Míhr Áli Khán as deputy viceroy. Náhir Khán was also appointed to the charge of Dholka, Dahod and Petlad, and made superintendent of customs. About this time the head tax was repealed, and orders were issued that its levy in Gujarát should cease.

Píláji Gáikwár at Songaḍ, 1719. In the same year, 1719, Píláji Gáikwár marched on Surat with a large army and defeated the Mughal troops commanded by Sayad Âkil and Muhammad Panáh, the latter commander being taken prisoner and forced to pay a heavy ransom. Píláji, finding Gujarát an easy prey, made frequent incursions, and taking Songaḍ in the extreme south-east established himself there. Míhr Áli Khán, who had been acting for Náhir Khán, marched against and subdued the Kolis, who were committing piracy in the Mahi estuary.

Decay of Imperial Power, 1720. From 1720, Mughal rule in Gujarát was doomed. Píláji Gáikwár was established at Songaḍ, and in the anarchy that ensued, the great Gujarát houses of the Bábis and Jháloris, as well as the newly arrived Momín Khán, turned their thoughts to independence. Ajítsingh so hated Mughal rule that he secretly favoured the Maráthás, and strove to establish his own authority over such portions of Gujarát as bordered on Márwár. In after years, Sarbuland Khán made a vigorous attempt to reassert Mughal dominion, but the seeds of dissolution were sown and efforts at recovery were vain.

In 1720, Ajítsingh the viceroy sent Anopsingh Bhandári to Gujarát as his deputy. In this year Nizám-ul-Mulk, viceroy of Ujjain, was superseded by Sayad Diláwar Khán. While Diláwar Khán was yet on the Málwa frontiers the Nizám desirous of possessing himself of the Dakhan (Deccan) and its resources retired to burhanpur pursued by Sayad Diláwar Khán, who giving battle was killed, the Nizám retiring to Aurangabad in the Dakhan. Álam Áli Khán, deputy viceroy of the Dakhan, was directed to march against him, while from north Gujarát Anopsingh Bhandári was ordered to send 10,000 horse to Surat, and Náhir Khán, the deputy viceroy, was instructed to proceed thither in person. The Nizám and Álam Áli Khán met near Bálápur in the Berárs and a battle was fought in which the Nizám was successful and Álam Khán was slain. At this time Anopsingh Bhandári committed many oppressive acts, of which the chief was the murder of Kapurchand Bhansáli, the leading merchant of Áhmedábád. The cause of Kapurchand's murder was that he had hired a number of armed retainers who used to oppose the Bhandári's orders and set free people unjustly imprisoned by him. To remove this meddler from his way the Bhandári got him assassinated.

Nizám-ul-Mulk Prime Minister, of the Empire, 1721 In 1721, Nizám-ul-Mulk was appointed prime minister of the empire, Abdúl Hamíd Khán was recalled from Sorath, and in his stead Asad Kuli Khán, with the title of Amir-ul-Umara, was appointed governor of Sorath and sent Muhammad Sharíf Khán into Sorath as his deputy.

Haidar Kúli Khán, Fiftieth Viceroy, 1721–22 In 1721, in conjunction with Muhammad Amín and Saádat Khán, Haidar Kúli Khán freed the emperor from the tyranny of the Sayads, and was rewarded with the title of Muîz-ud-daulah Haidar Kúli Khán Bahádur Zafar Jang and the viceroyalty of Gujarát. He obtained the appointment of minister for his brother Jaâfar Kúli Khán. Maâsúm Kúli Khán was dignified by the title of Shujáât Khán Bahádur and appointed deputy viceroy.

Disorder in Áhmedábád, 1721 As soon as this change was notified, the people of Áhmedábád, who were discontented with the rule of Anopsingh Bhandari, attacked his palace, the Bhadra, and he escaped with difficulty. In consequence of the enmity between Haidar Kúli Khán and the Márwáris, Shujáât Khán, the deputy viceroy, attacked the house of Náhir Khán who had been Ajítsingh's minister, and forced him to pay Rupees 100000 and leave the city. Shujáât Khán next interfered with the lands of Safdar Khán Bábi, the deputy governor of Godhra, and his brothers. On one of the brothers repairing to Delhi and remonstrating, Haidar Kúli, restored their lands to the Bábis. In consequence of this decision ill-feeling sprung up between Shujáât Khán and the Bábis, and when Shujáât Khán went to exact tribute he forced Muhammad Khán Bábi, governor of Kaira (Kheda district), to pay a special fine of Rupees 10000. Shortly after one of the viceroy's officers, Kásím Áli Khán, while employed against the Kolis of that part of the country, was killed at Pethapur. Shujáât Khán advanced, and revenged Kásím Áli's death by burning the town. Next, he passed into Sorath, and after exacting tribute, crossed to Kutch. The chief opposed him, and in the fight that followed was beaten and forced to pay about Rupees 225000. In 1721, a Sayad was sent to Sorath as deputy governor in place of Muhammad Sharíf, and Haidar Kúli was appointed governor of Kadi, the Chúnvál, and Halvad (called Muhammadnagar), and put in charge of Tharad, Arjanpur, Bhámnárli, Pethápur, and Kheralu in place of Vakhatsingh, son of the Mahárája Ajítsingh.

Early in 1722, Nizám-ul-Mulk took up the office of prime minister of the empire, to which he had been appointed in the previous year. Strenuous efforts were made to embroil him with Haidar Kúli Khán, as the Nizám's austerity and craft were a source of not less anxiety to the Dehli court than Haidar Kúli's more daring and restless ambition. Haidar Kúli Khán, unable to contend with the Nizám, left Dehli and retired to Gujarát. On his way the villagers of Dabháli opposed him killing one of his chief men named Alif Beg Khán. Haidar burned the village and put all the people to death, a severity which caused such terror that throughout his rule no difficulty was experienced in realizing tribute or in keeping the roads safe. About this time, among other changes, Muhammad Bahádúr, son of Salábat Khán Bábi, was placed in charge of Sádra and Virpur, with the title of Sher Khán. Shortly after his arrival the viceroy marched against and subdued the rebellious Kolis of the Chunvál, appointing Rustam Áli Khán his governor there. Then, returning to Áhmedábád, he took up his residence in the Bhadra.

Shows signs of Independence and is Recalled, 1722. At this time Haidar Kúli aimed at bringing all Gujarát under his rule. He seized the imperial horses which passed through Áhmedábád on their way to Delhi, and confiscated many estates and gave them to his own men. On his way to enforce tribute from the Dungarpúr chiefs, he levied Rupees 80,000 from Lunavada. Through the mediation of the Udaipur Rána, and as he agreed to pay a tribute of Rupees 100000, the Rával of Dungarpur escaped. Haidar Kúli next proceeded to Vijapur, north of Áhmedábád, but hearing that the emperor was displeased at his assumption of the power of giving and changing grants of land, he returned to Áhmedábád and restored several estates which he had confiscated.

Nizám-ul-Mulk, Fifty-first Viceroy, 1722 As the emperor continued to distrust Haidar Kúli Khan for his act to be free, and at the close of 1722 appointed Jumlat-ul-Mulk Nizám-ul-Mulk fifty-first viceroy.