The Battle of Ghazni was fought in 998 between the rival Ghaznavid forces of Amir Ismail and the rebel forces of his older brother Mahmud of Ghazni.
[1] On his death-bed Amir Sabuktigin had designated Ismail as his successor while Mahmud, the older brother who was involved in the Samanids civil war, was stationed in Nishapur.
[1] Upon receiving these news Mahmud contested Ismail's right to the throne and divested his charge of Nishapur to his uncle Borghuz and younger brother Nur-ud-Din Yusuf and marched upon Ghazni.
Both armies met at Ghazni, Ismail's containing elephants.
[1] The battle was a long, drawn out affair, but at an opportune moment Mahmud charged Ismail's center which broke up.