The decline of Islamic rule in the Indian Subcontinent (India, Pakistan and Bangladesh) started most notably after Chhatrapati Shivaji's rebellion against all foreign rule, both Muslim and European. He declared "Hindu Swarajya" (Self Rule of Hindus) and started assaulting the mighty Mughal Empire. Such was the impact of Shivaji on the Mughal Empire's decline that he was called the "Attila The Hun Of South Asia" by many contemporary European accounts. Lawlessness prevailed in the Mughal Empire. Shivaji sacked Surat, the richest port of the Mughal Empire, twice, in 1663 and 1674. [30] While comparing the Mughal Emperor Akbar with Shivaji in terms of military capability, Vincent Arthur Smith noted that Shivaji was a great warrior while on the other hand Akbar was more of an administrator and like his great grandson Aurangzeb his presence would have not stopped the decline of the Mughal Empire.[31] The Maratha War of Independence proved disastrous for the Mughal Empire as well as for Aurangzeb. The long and futile war bankrupted one of the most powerful empires in the world. Mountstart Elphinstone termed this a demoralizing period for the Mussalmans as many of them lost the will to fight against the Maratha Empire.[32] The Maratha Empire started to extend its reach defeating the Mughal Empire in a number of battles. Peshwa Baji Rao I carried his raid as far as Delhi and in 1737 defeated the Mughal General Amir Khan in Delhi.[33] The invasion of Nadir Shah on Delhi in 1739 came two years after the Maratha Invasion of Delhi in 1737 showing that the once powerful Mughal Empire was in complete shambles even before Nadir Shah invaded Delhi. In the 1740s the Maratha Empire annexed Bengal, Bihar and Orissa.[34] In 1758 the Maratha Empire after expelling Timur Shah Durrani, son of Ahmad Shah Durrani and his commander in chief Jahan Khan from Lahore, expanded their Empire all the way up to Peshawar.[35] Ahmad Shah Abdali (Ahmad Shah Durrani) after assessing the power of the Marathas decided to make alliances with other Muslim Powers in order to confront the powerful Maratha Empire. Acknowledging the might of the Maratha Empire extending into Afghanistan and into other Muslim countries, Durrani enlisted two major Muslim allies, Nawab Shuja-ud-daulah of Oudh and Afghan Rohilla Chief Najib-Ud-Daulah. On the other hand the Marathas were refused support by Hindu powers such as the Rajputs, Jats and Sikhs.[36] The defeat in the Third Battle of Panipat from the coalition forces of Durrani Empire, Rohillas and the Nawab of Oudh was a major setback but it didn't demolish the Marathas. By 1770 the Maratha Empire once again regained control of Delhi, the imperial capital of Hindustan, and nominated their own nominee to the post of Mughal Emperor.[37] The Rohilla chief Najib-Ud-Daulah's son Zabita Khan accepted the Maratha Suzerainty. The Afghan raids were also put to n end after Ahmad Shah Abdali fell ill. For the next 30 years the Marathas ruled Delhi until their defeat at the hands of the British in the Second Anglo-Maratha War. The Maratha Army was defeated at Assaye, Aligarh, Farrukhabad and finally in Delhi and then in Patiala by the British.[38] Hence by 1803 almost the whole of modern day India and Bangladesh came under the sway of the British Empire, though the Marathas ruled large parts of western India till 1818 when the Third Anglo-Maratha War was fought which ended the Maratha Empire completely.
Sikh Empire, established by Ranjit Singh in North-west India.
In northwest India, in the Punjab, Sikhs developed themselves into a powerful force under the authority of twelve Misls. By 1801, Ranjit Singh captured Lahore and threw off the Afghan yoke from North West India.[39] In Afghanistan Zaman Shah Durrani was defeated by powerful Barakzai chief Fateh Khan who appointed Mahmud Shah Durrani as the new ruler of Afghanistan and appointed himself as Wazir of Afghanistan.[40] Sikhs however were now superior to the Afghans and started to annex Afghan provinces. The biggest victory of the Sikh Empire over the Durrani Empire came in the Battle of Attock fought in 1813 between Sikh commander-in-chief Dewan Mokham Chand who was a Hindu Khatri and was 70 years old at the time of battle, and Wazir of Afghanistan Fateh Khan and his younger brother Dost Mohammad Khan. The Afghans were routed by the Sikh army and the Afghans lost over 9,000 soldiers in this battle. Dost Mohammad was seriously injured whereas his brother Wazir Fateh Khan fled back to Kabul fearing that his brother was dead.[41] In 1818 the famous Hindu general Misr Diwan Chand slaughtered Afghans and Muslims in trading city of Multan killing Afghan governor Nawab Muzzafar Khan and five of his sons in the Siege of Multan.[42] In 1819 the last Indian Province of Kashmir was freed from Muslim rulers by Misr Diwan Chand who registered another crushing victory over weak Afghan General Jabbar Khan.[43] The Koh-i-Noor diamond was also freed from Muslim control by Maharaja Ranjit Singh in 1814. In 1823 a Sikh Army led by Misr Diwan Chand routed Dost Mohammad Khan the Sultan of Afghanistan and his brother Azim Khan at Naushera (Near Peshawar). By 1834 the Sikh Empire extended up to the Khyber Pass thus recovering the whole of the Indian Subcontinent from Islamic Rule. Hari Singh Nalwa the Sikh general remained the governor of Khyber Agency till his death in 1837. He consolidated Sikh hold in tribal provinces. The northernmost Indian territories of Gilgit, Baltistan and Ladakh was annexed by Dogra Rajput General Zorawar Singh between 1831-1840.[44]