The Lodi Dynasty, who came from Afghanistan, took over after the failed Sayyid. He reconsolidated northern India and improved the dynasty after the weak rule of the Sayyid Dynasty. The Lodi Dynasty fell after the First Battle of Panipat in 1526 duirng which Babur defeated the far larger Lodi armies and killed Ibrahim Lodi. (jan 1, 1451 – jan 1, 1526)