Mahmud of Ghazni

Mahmud of Ghazni, (, ; (2 November 971 - 30 April 1030) commonly known as Mahmud Ghaznavi, was the ruler of the Ghaznavid Empire from 997 until his death. He turned the former provincial city of Ghazni into the rich capital of an extensive empire which included modern-day Afghanistan, most of Iran, and parts of north-west India including modern-day Pakistan. He was also the first ruler to carry the title Sultan, signifying his break from the power of the Islamic Caliph.
Mahmud of Ghazni was known as Yamin al-Dawlah Mahmud (in full: Yamin al-Dawlah Abd al-Qasim Mahmud ibn Sebuk Tegin). He was the eldest son of Emir Sebuktegin. When he was young, Mahmud helped his father gain land through military campaigns against Turk nobles. In 997, he overthrew his younger brother, Ismail, who had been nominated for the throne after his father's death. As soon as he had the throne, he went out to conquer territory.
Between 1000 and 1026, he invaded India at least 17 times. He led the first major Muslim army to invade India. His conquest of the entire Punjab including Haryana all the way up to Agra was the last invasion where he increased his territory in India. From then on, most of Mahmud's raids were to gain wealth. Mahmud's last and most famous raid was on Somnath. This is a temple city on the Gujarati coast that was also a pilgrimage site. The temple had many riches: heavy golden chains and thousands of jewels. The battle was violent, and more than 50,000 people died. Mahmud's army won and plundered the temple of its riches and wealth.
With all his riches, Mahmud founded a university, a library, and a museum, a grand mosque and richened his capital. When Mahmud was about to die, he ordered all of his riches to be placed before him. Mahmud died on 30 April 1030.
Campaign timeline
As Emir
994: Gains the title of Saif ad-Dawla and becomes Governor of Khorasan under service to NuhII of the Samanid Empire in civil strife
995: The Samanid rebels Fa'iq (leader of a court faction that had defeated Alptigin's nomination for Emir) and Abu Ali expel Mahmud from Nishapur. Mahmud and Sabuktigin defeat Samanid rebels at Tus
997: Kara-Khanid Khanate
As Sultan
999: Khorasan, Balkh, Herat, Merv from the Samanids. A concurrent invasion from the north by the Qarakhanids under Elik Khan (Nasr Khan) ends Samanid rule.
1000: Sistan from Saffarid dynasty
1001: Gandhara: Sultan Mahmud defeats Raja Jayapala in the Battle of Peshawar; Jayapala subsequently abdicates and commits suicide.
1002: Seistan: Is imprisoned in Khuluf
1004: Bhatia (Bhera) is annexed after it fails to pay its yearly tribute.
1005-6: Multan: Fateh Daud, the Ismaili ruler of Multan revolts and enlists the aid of Anandapala. Mahmud massacres the Ismailis of Multan in the course of his conquest. Anandapala is defeated at Peshawar and pursued to Sodra (Wazirabad) in modern day Gujranwala and the region is partly annexed by Mahmud. Mahmud then goes on to capture Bathinda from its ruler, Sukhapala.
Ghor and Muhammad ibn Suri are then captured by Mahmud, made prisoner along with Muhammad ibn Suri's son, and taken to Ghazni, where Muhammad ibn Suri dies.
Appoints Sewakpal to administer the region. Anandapala flees to Kashmir, fort in the hills on the western border of Kashmir. Mehmud attacks the fort but fails to capture it so he destroys every village in Kashmir during his retreat back to Afghanistan. He also defeats an army near Mirpur and captures the area appointing a Muslim governor. He establishes a caravan in the modern day city of Rawalpindi and fully annexes the Pothohar region.
1005: Defends Balkh and Khorasan against NasrI of the Kara-Khanid Khanate and recaptures Nishapur from Isma'il Muntasir of the Samanids.
1005: Sewakpal rebels and is defeated.
1008: Mahmud defeats the Indian Confederacy (Ujjain, Gwalior, Kalinjar, Kannauj, Delhi, and Ajmer) in the Battle of Chach near Hazro in Chach, and captures the Shahi treasury at Kangra, Himachal Pradesh and appoints a governor.
Note: A historical narrative states in this battle, under the onslaught of the Gakhars, Mahmud's army was about to retreat when King Anandapala's elephant took flight and turned the tide of the battle.