Ibrahim Lodi was the ruler of Delhi when Babur attacked India. He became the Sultan of Delhi in 1517 after the death of his father Sikandar. He was the last ruler of the Lodhi dynasty, reigning for nine years between 1517 until being defeated and killed at the battle of Panipat by Babur's invading army in 1526, giving way to the emergence of the Mughal Empire in India.