The foundation for the Mughal empire was established around the early 1500s by the Timurid prince Babur, a descendant of Genghis Khan and Timur, when he took control of Doab and eastern regions of Khorasan controlling the fertile Sindh region and the lower valley of the Indus River. In 1526, Babur defeated the last of the Delhi Sultans, Ibrahim Shah Lodi, at the First Battle of Panipat. Babur was invited to invade the Delhi Sultanate by Rana Sanga, who thought after defeating Ibrahim Lodhi, Babur would go back and he would become Ruler of Delhi. To secure his newly founded kingdom, Babur then had to face the Rajput confederacy led by Rana Sanga of Chittor, at the battle of Khanwa. These early military successes of the Mughals, achieved by an army much smaller than its opponents, have been attributed to their cohesion, mobility, horse-mounted archers, and use of artillery.
The last Emperor, Bahadur Shah II, whose rule was restricted to the city of Delhi, was imprisoned and e