The Lodhi dynasty was an Afghan dynasty which ruled Delhi Sultanate from 1451 to 1526. Bahlul Khan Lodhi, Sikander Lodhi and Ibrahim Lodhi were the three kings who ruled over a period of time with the Ibrahim Lodi's tenure being the shortest and the last. It came to an end when Babur attacked the empire and they fought the first Battle of Panipat where Ibrahim Lodi was defeated. This marked the end of the empire of Lodi dynasty and the beginning of Mughal Empire in India which would eventually rule for next 200 years until about year 1720.