Early modern era
Many dynasties ruled Indian subcontinent around the 16th to the 17th century. Some of these were the Mughals in the north and the Marathas in the south. Babur, descendant of Timur and Genghis Khan from Fergana Valley (modern day Soviet Central Asia), swept across the Khyber Pass and established the Mughal Empire in 1526. The Mughal dynasty ruled most of the Indian subcontinent by 1600, including modern day India, Pakistan, Afghanistan, and the Deccan. The Mughal rulers balanced and pacified the local society through new administrative practices and diverse and inclusive ruling elites, leading to more systematic, centralized, and uniform rule.
The Mughals united their far-flung realms through loyalty, expressed through a Persianised culture, to an emperor who had near-divine status. The Mughals brought India into relative peace and prosperity, resulting in greater patronage of painting, literary forms, textiles, and architecture. The reign of Shah Jahan was the golden age of Mughal architecture. He erected several large monuments, the most famous of which is the Taj Mahal at Agra, as well as the Moti Masjid, Agra, the Red Fort, the Jama Masjid, Delhi, and the Lahore Fort.
Expanding commerce during Mughal rule, however, gave rise to new Indian commercial and political elites along the coasts of southern and eastern subcontinent. As the empire disintegrated, many among these elites were able to seek and control their own affairs. The Mughals suffered several blows due to invasions from Marathas from the south and Afghans from the west. In 1739, the Mughals were crushingly defeated in the Battle of Karnal by the forces of Nader Shah, the Emperor of Persia. After this victory, the Mughal dynasty was reduced to puppet rulers by 1757.
British Rule in India
By the early 18th century, with the lines between commercial and political dominance being increasingly blurred, a number of European trading companies, including the English East India Company, had established coastal outposts. In 1765, Robert Clive (1725-1774) lead the East India Company to an expanded influence in India with victories over the French, the Bengalis, and the Mughals. In the hundred years after the battle, the East India Company conquered the entire northern part of Indian subcontinent, which included present-day India and Pakistan, by trade, political intrigue, and direct military action. Technological changes, such as railways, canals, and the telegraph, were introduced in Indian subcontinent not long after their introduction in Europe.
However, disaffection with the Company also grew during this time, and set off the Indian Rebellion of 1857. The rebellion was brutally suppressed by the Company as the rebels were disorganized, had differing goals, and were poorly equipped. The Mughal Emperor, Bahadur Shah II, who supported and nominally led the rebellion, was exiled to Rangoon by the Company and the remnants of his empire were taken over by the British, marked the end of more than three centuries of Mughal rule in the subcontinent. Nevertheless, the rebellion shook the foundations of Company rule in India. Afterward the British government took control away from the Company. In 1858, a part of the British Empire and Queen Victoria was crowned as the Empress of India.
After 1857, the British rule in India strengthened and expanded its infrastructure via the court system, legal procedures, and statutes. The Indian imperial government invested heavily in infrastructure, including canals and irrigation systems in addition to railways, telegraphy, roads and ports. However, the rush of technology and the commercialization of agriculture in the second half of the 19th century was marked by economic setbacks.