The foreign relations of the Mughal Empire were characterized by competition with Safavid Persia to the west, the Marathas and others to the south, and the British to the east. Steps were taken by successive Mughal rulers to secure the western frontiers of India. The Khyber Pass along the Kabul-Qandahar route was the natural defence for India, and their foreign policy revolved around securing these outposts, as also balancing the rise of powerful empires in the region.
During the break up of the Timurid Empire in the 15th century, the Ottomans in Turkey, the Safavids in Persia and the Uzbeks in Central Asia emerged as the new contenders of power. While the Safavids were Shia by faith, the Ottomans along with Uzbeks were Sunni. The Mughals were also Sunni and Uzbeks were their natural enemies, who caused Babur and other Timurid princes to leave Khorasan and Samarkand. The powerful Uzbeks who held sway over central Asia sought an alliance of Sunni powers to defeat the Shia-ruled Persia, but Mughals were too broadminded to be driven away by the sectarian conflicts. The Mughal emperors, especially Akbar, were keen to develop strong ties with Persia in order to balance the warring Uzbeks. Thus, the foreign policy of Mughals was centred around strengthening their ties with Persia, while maintaining the balance of power in the region by keeping a check on the evolution of a united Uzbek empire.
Arabian Peninsula The Mughal emperors were generally enthusiastic with their donation with the Shariff of Mecca.
Mariam-uz-Zamani built a massive trading ship named Rahīmī for trade and Hajj pilgrims at the Khizri Darwaza on the Ravi River. This place was later renamed by Maharaja Ranjit Singh as Sheranwala Darwaza. The Rahimi was homeported in Surat but often travelled to Jeddah, the port near Mecca on the Red Sea, where she carried merchandise for the vendors of the holy city and trafficked in pilgrims on various parts of their journey. The successor of Shah Jahan, Aurangzeb, also owned a trading ship bigger than Rahīmī, Ganj-i-Sawai, which mainly purposed for annual Hajj pilgrimage travel from India to Hejaz.
Another example was the Mughal emperor appointing an official title of "Mir Haj" in 1577 with 500,000 rupee and 10,000 Khil'lat for attribution for the Shariff, and distributing many more to the peoples of Mecca and Medina (which usually called al-Haramayn, or two holiest cities of Islam). Aside from minted coins, the Mughals also gave more non currency gifts such as candlestick studded with diamonds, which estimated as 100 carats according to some historians. At one point, the Shariff of Mecca also exchanging gift with the Mughal by giving them Arabian horses, high quality swords, and some sacred relics.
Mughal chronicler Muhammad Saqi Musta'id Khan has recorded in his work, Ma'asir-i-Alamgiri, that emperor Aurangzeb, who known for his strict observance of Islamic teachings. Aurangzeb also has reportedly shipped two Quran manuscripts which personally transcribed by himself to Medina as gifts. Rishad Choudhury interprets the phrase "ba-masāba hajj-i kobra būd" in the Ma'asir-i-Alamgiri to suggest that Aurangzeb's patronage of the Hajj through financial support, Quranic offerings, and salaried delegates was considered spiritually equivalent to performing the pilgrimage himself.
Europeans
The Mughal Empire had developed relationships with Europeans such as British, Portuguese, Russia, and France.
Mughal relations with the British in the 16th century were quite difficult, as local Mughal officials usually exploited the East India Company, who responded the Mughal's harmful policies towards the British interest with harassing the Mughal vessels at the sea. The Mughals, with dominant military power in India, usually responded with threats, which caused the EIC to cease hostilities and both sides returned the status quo relationship.
Britain The East India Company persuaded King James I to send Thomas Roe as a royal envoy to the Agra court of the Mughal emperor, Jahangir. Roe resided at Agra for three years.
Together with Thomas Roe, William Hawkins, captain of Hector, a first company ship, arrived at Surat in India on 24 August 1608. William travelled to Agra to negotiate consent for a factory from Emperor Jahangir in 1609. Hawkins even gained trust from emperor Jahangir and was appointed as Mansabdar or military governor of Mughal territories. Hawkins himself has provided records about the details about the administrations of Mansabdar, where during his life, he has recorded about 41 names of Mansabdar officers who commanded about 3,000-5,000 Zat or horsemens. Roe allegedly gained favour of Jahangir and may have been his drinking partner; certainly he arrived with gifts of "many crates of red wine" However, It was thought that Roe's political career in the Mughal court also ended due to a report about roe's drinking habit reached Jahangir, who strongly forbade wine in his court. This incident caused Roe to fell from favour of Jahangir.
In the thirty years following 1603, the trading factories established by the English on at Machilipatnam (estd. 1611) reported to English Bantam.
Dutch
The Mughal Empire also recorded to establish relationship the Dutch, particularly with their trading company Dutch East India Company, as shown when the Dutch has established their embassy within Mughal empire. The company representative, Van Adrichem, was presented with Arabian horses, a red cloth, green cloth, lacquered palanquin, Japanese drawer, several Japanese boxes, a Venetian made mirror, two Japanese shields, and couple of exotic Bird-of-paradise. The first Dutch factory was first established at Surat by Pieter van den Btoecke.
In 1602, the Dutch government sponsoring the creation of a single "United East Indies Company" that was also granted monopoly over the Asian trade. For a time in the seventeenth century, it was able to monopolise the trade in nutmeg, mace, and cloves and to sell these spices across European kingdoms and Akbar of the Mughal Empire at 14–17 times the price it paid in Indonesia.
During the reign of Jahangir, after intense lobbying by VOC factors during Jahangir's visit to Ahmedabad, Jahangir issued the first known Firman directed towards the VOC in Gujarat, contained in a letter from P. G. van Ravesteyn and A. W. Goeree to Jan Pieterszoon Coen, dated 12 March 1618. The firman granted few notable assurances to the factors, such as freedom to trade at any Mughal ports, autonomy to govern their affairs, application of normal customs duty (believed to be 2.5% during Jahangir's reign), freedom to trade with local merchants and profess their religion.
France In 1667, the French East India Company ambassadors Le Gouz and Bebert presented Louis XIV of France's letter which urged the protection of French merchants from various rebels in the Deccan. In response to the letter, Aurangzeb issued a firman allowing the French to open a factory in Surat.
François Caron succeeded in founding French outposts at Surat around 1668; where he was said to be accompanied by a Persian named Marcara,.. and at Masulipatam around 1669; and Louis XIV acknowledged those successes by awarding him the Order of St. Michael.
Ethiopian Empire Ethiopian Emperor Fasilides dispatched an embassy to India in 1664–1665 to congratulate Aurangzeb upon his accession to the throne of the Mughal Empire.
Aceh Sultanate For decades, the Malabari Mappila Muslims which representing the Mughal Empire are already patronized Aceh Sultanate. Aurangzeb, and his brother, Dara Shikoh, participated with Aceh trade and Aurangzeb himself also exchanging presents with the Sultan of Aceh in 1641. In that year, it is recorded the daughter of Iskandar Muda, Sultanah Safiatuddin, has presented Aurangzeb with eight elephants.
When the Dutch East India Company tried to disrupt the trade in Aceh to make their own Malaka trade lucrative, Aurangzeb threatened the Dutch with retaliation against any losses in Gujarat due to Dutch intervention. This effort were caused due to VOC realization that Muslim tradings were damaging to the VOC. The Firman issued by Aurangzeb caused the VOC to back down and allowed Indian sailors to pass into Aceh, Perak, and Kedah, without any restrictions.
Safavid dynasty In 1626, Emperor Jahangir began to contemplate an alliance between the Ottoman Empire, the Mughals, and the Khanate of Bukhara of the Uzbeks against the Safavids, who had defeated the Mughals at Kandahar. He even wrote a letter to the Ottoman Sultan, Murad IV. Jahangir's ambition did not materialise due to his death in 1627.
Aurangzeb establish an embassy of Abbas II of Persia in 1660 and presented him with gifts. However, relations between the Mughal Empire and Safavid Iran was not cooperative since the Safavids attacked the Mughal army near Kandahar. Aurangzeb had prepared his armies in the Indus River Basin for punitive campaign, although the death of Abbas II in 1666 caused Aurangzeb to cease the hostility. Aurangzeb's rebellious son, Sultan Muhammad Akbar, also known refuge with Suleiman I of Persia, who had rescued him from the Imam of Musqat. However, the Imam later refused to assist Sultan Muhammad in any military campaign against Aurangzeb.
The relationship between the Mughals and Persia was cordial but the Qandhar served as a bone of contention between them, being claimed by both. Qandhar was a strategic place and could serve as a better defence against any future onslaught from North-West. Before 1507, the year in which Uzbeks ousted the cousins of Babur from Qandhar, it was ruled by Timurid princes. For the Persians, Qandhar was not a strategic fort but for Mughals it was of much importance. It was well supplied with water, was necessary for protection of Kabul and controlling it implied the best way to keep a tab upon the Afghan and Baluch tribes who possessed a tribal sense of independence and were difficult to control otherwise. Qandhar was also a rich and fertile area and after conquest of Sindh and Baluchistan, Akbar was determined to capture it. Akbar also wanted to promote trade via it.
Initially in the reign of Jahangir, Nur Jahan served as a bridge between the Mughals and Persians, and due to her connections with the Persia, relationship remained cordial. In 1620, Shah Abbas I, the ruler of Persia, sent a friendly request to Jahangir to return the Qandhar and subsequently made preparation for the expedition. Jahangir was surprised and he decided to send prince Khurram to Qandhar, but the prince put many impossible demands and was reluctant to move onto the campaign. This was the phase of tussle between Nur Jahan and Prince Khurram, who was supported by his father in law Asaf Khan. Thus, Qandhar passed into Persian hands by 1622. Abbas I sent lavish embassies and costly gifts to erase the bitterness that developed in the mind of Jahangir after his failure at Qandhar, but the cordiality in the Mughal-Iran relationship came to an end.
In 1629, following the death of Shah Abbas I, Shah Jahan, who succeeded Jahangir made the Persian governor Ali Mardan Khan to his side and formally Qandhar was retained by the Mughals in 1638.Majumdar, R.C. (ed.) (2007). The Mughul Empire, Mumbai: Bharatiya Vidya Bhavan, , p. 204- Mahajan, V.D. (1991, reprint 2007). History of Medieval India, Part II, , p. 144 In 1647, the setback of Mughals at Balkh even after winning the war against Uzbeks emboldened the Persians to attack and conquer Qandhar (1649). The success of Aurangzeb in the battle against Uzbeks persuaded Shah Jahan to send him to Qandhar with an army of 50,000. Mughals under Aurangzeb though defeated Persians but were not able to capture the fort.