Wikipedia
Anandapala
Anandapala or Anantpala was the third and last ruler of the Kabul Shahi dynasty in Afghanistan and Pakistan. His reign began in 1001 CE and ended in or about 1010. He was the son of Jayapala, whose kingdom used to stretch from Laghman to Kashmir and Sirhind to Multan, with Peshawar being in the center, but had lost most of his territories to Sabuktagin and his son Mahmud. Anandapala and his confederacy was defeated by Mahmud of Ghazni when his elephant suddenly took flight and turned the tide of the battle.