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.