Ibrahim Lodi was the last ruler of the Lodi dynasty (1517-1526 CE) and the final Sultan of the Delhi Sultanate. He was defeated by Babur in the First Battle of Panipat in 1526, which ended the Delhi Sultanate and began the Mughal Empire. The Lodi dynasty was an Afghan dynasty that ruled parts of northern India from 1451 to 1526. Ibrahim was not from the Suri, Hanover (European), or Mughal dynasties.