The Battle of Ghazni was fought in 1117 between the Seljuk forces supporting the claim of Bahram of Ghazna and the army of his brother the ruling Sultan Arslan-Shah of Ghazna.
[1] The death of Mas'ud III of Ghazni in 1115 began a heated contest for the throne.
Arslan had to face the rebellion of his other brother, Bahram, who received support from the Seljuk Sultan Ahmad Sanjar.
[2] Ahmad Sanjar invading from Khorasan took his army into Afghanistan and inflicted a crushing defeat to Arslan near Ghazni at Shahrabad.
Arslan managed to escape and Bahram succeeded to the throne as the Seljuk's vassal.