Mahmud was the ruler of Ghazni. He wanted to make Ghazni a big and powerful kingdom. India was extremely rich. So he planned to attack India in order to bring back wealth and thus build a larger army to conquer Central Asia.
The description of his main invasions is as follow :
1. Invasion on Jaipal (1001 A.D.). He invaded Jaipal the Hindu royal ruler of Punjab. Jaipal was defeated and imprisoned. It is said that Mahmud got 2.5 lac gold coins from Jaipal and set him free. Jaipal could not tolerate this insult and put himself to fire.
2. Battle with Anandpal (1008 A.D.). Anandpal was the son of Jaipal. He fought Mahmud Ghaznavi by combining the armies of Ujjain, Gwalior, Kalinjar, Delhi and Ajmer. The battle near Peshwar was terrible but Mahmud emerged victoriously and after that he plundered Punjab.
3. Invasion of Nagarkot (1009 A.D.). He invaded Nagarkot (Kangra) and looted gold and silver from Kangra temples.
4. Invasion on Thanesar (1014 A.D.). Again Ghaznavi plundered the big temples of Thanesar by invading this place.
5. Invasion on Mathura and Kanauj (1018-1019 A.D.). In 1018 A.D., Mahmud reached Mathura but before that he plundered the temples on the way to Mathura and set these on fire. When he reached Mathura, he demolished the temples there also. From Mathura he reached Kanauj. The ruler of Kanauj surrendered and Mahmud plundered and demolished the temples there.
6. Invasion on Kalinjar (1021 A.D.). The ruler of Kalinjar Vidyadhar had a big army but still he could not face Mahmud and ran away from the battlefield.
7. Invasion on the temple of Somnath (1025 A.D.)—Mahmud Ghaznavi attacked the temple of Somnath in Kathiawar in Gujarat. This temple was famous for its unlimited resources. Besides it was considered the holiest temple of the Hindus. Mahmud plundered and demolished this temple and took hundreds of tons of gold and silver and diamonds to his country. It was the biggest victory of Mahmud for which he was honoured by the Caliph. In 1030 A.D. Mahmud died.