section_path: History/Early modern period
section_name: Early modern period
paragraph_text: Early modern period
  
  In 1526, Babur, a descendant of Genghis Khan and Timur from the Fergana Valley in modern-day Uzbekistan, invaded India and defeated the last Lodhi sultan in the First Battle of Panipat and founded the Mughal Empire that ruled from Delhi and Agra. The Mughal dynasty ruled Delhi for more than three centuries, with a sixteen-year hiatus during the reigns of Sher Shah Suri and Hemu from 1540 to 1556. Shah Jahan built the seventh city of Delhi that bears his name Shahjahanabad, which served as the capital of the Mughal Empire from 1638 and is today known as the Old City or Old Delhi.
  
  After the death of Aurangzeb in 1707, the Mughal Empire's influence declined rapidly as the Hindu Maratha Empire from Deccan Plateau rose to prominence. In 1737, Maratha forces led by Baji Rao I sacked Delhi following their victory against the Mughals in the First Battle of Delhi. In 1739, the Mughal Empire lost the huge Battle of Karnal in less than three hours against the numerically outnumbered but militarily superior Persian army led by Nader Shah of Persia. After his invasion, he completely sacked and looted Delhi, carrying away immense wealth including the Peacock Throne, the Daria-i-Noor, and Koh-i-Noor. The Mughals, severely further weakened, could never overcome this crushing defeat and humiliation which also left the way open for more invaders to come, including eventually the British. Nader eventually agreed to leave the city and India after forcing the Mughal emperor Muhammad Shah I to beg him for mercy and granting him the keys of the city and the royal treasury. A treaty signed in 1752 made Marathas the protectors of the Mughal throne in Delhi. The city was sacked again in 1757 by the forces of Ahmad Shah Durrani, although it was not annexed by the Afghan Empire and being its vassal state under the Mughal emperor. Then the Marathas battled and won control of Delhi from the Afghans.