He faced a number of rebellions. The Mewar ruler Rana Sangram Singh extended his empire right up to western Uttar Pradesh and threatened to attack Agra. There was rebellion in the East also. Ibrahim Lodi also displeased the nobility when he replaced old and senior commanders by younger ones who were loyal to him. He further alienated them by throwing some of the older noblemen in prison. His Afghan nobility eventually invited Babur to invade India. In 1526, the Mughal forces of Babur, the king of Kabulistan, defeated Ibrahim's much larger army in the 1st Battle of Panipat. Ibrahim was killed during the battle. It is estimated that Babur's forces numbered around 12,000 men. His army had between 20 to 24 pieces of field artillery. Ibrahim Lodi had around 30,000-40,000 men along with at least 100 war elephants. After Ibrahim Lodi was overthrown, the mughals invaded India.