The Battle of Ghazni was fought in 1151 between the Ghurid army of Ala al-Din Husayn and the army of the Ghaznavid Sultan Bahram-Shah of Ghazna. The Ghurid ruler defeated Bahram-Shah captured the city and destroyed it as revenge for the execution of his brother Quṭb ud-Dīn in 1149.
References
Battle of Ghazni (1151) Wikipedia(Text) CC BY-SA