Mahmud of Ghazni
Reign

Sabuktigin died in 997, and was succeeded by his son Ismail as the ruler of the Ghaznavid dynasty. The reason behind Sabuktigin's choice to appoint Ismail as heir over the more experienced and older Mahmud is uncertain. It may have been due to Ismail's mother being the daughter of Sabuktigin's old master, Alptigin. Mahmud shortly revolted, and with the help of his other brother, Abu'l-Muzaffar, the governor of Bust, he defeated Ismail the following year at the battle of Ghazni and gained control over the Ghaznavid kingdom. That year, in 998, Mahmud then traveled to Balkh and paid homage to Amir Abu'l-Harith Mansur b. Nur II. He then appointed Abu'l-Hasan Isfaraini as his vizier, and then set out west from Ghazni to take the Kandahar region followed by Bost (Lashkar Gah), which he transformed to a militarised city.

Mahmud initiated the first of numerous invasions of North India. On 28 November 1001, his army fought and defeated the army of Raja Jayapala of the Kabul Shahis at the Battle of Peshawar. In 1002 Mahmud invaded Sistan and dethroned Khalaf ibn Ahmad, ending the Saffarid dynasty. From there he decided to focus on Hindustan to the southeast, particularly the highly fertile lands of the Punjab region.

Mahmud's first campaign to the south was against an Ismaili state first established at Multan in 965 by a da'i from the Fatimid Caliphate in a bid to curry political favor and recognition with the Abbasid Caliphate; he also engaged elsewhere with the Fatimids. At this point, Jayapala attempted to exact revenge for an earlier military defeat at the hands of Mahmud's father, who had controlled Ghazni in the late 980s and had cost Jayapala extensive territory. His son Anandapala succeeded him and continued the struggle to avenge his father's suicide. In the Battle of Chach, he assembled a powerful confederacy that suffered defeat as his elephant turned back from the battle at a crucial moment, turning the tide in Mahmud's favor once more at Lahore in 1008 and bringing Mahmud control of the Shahi dominions of Udbandpura.
oulipo:avoid_letter[t], change_case:english_lowercase