When the allied forces were moving forward to engage the enemy, the latter threw big fireballs at the elephants which frenzied them and caused them to crush their own troops, turning it into a victory for the invaders. Consequently, the rest of India came under Muslim rule for almost 400 years. Ghazni won the battle and Anandpal had to cede the territory and its treasures.[4][5]