Ghaznavids is the name for the Muslim dynasty that ruled Afghanistan, north-western India and most of modern Iran for more than 200 years. It was founded by Alptigin (died 963), a Samanid slave, who conquered the mountain town of Ghazni in 962 and made it into an independent kingdom. Muhammad of Ghur (1174-1206) deposed the last Ghaznavid ruler in 1186.
Mahmud Of Ghazni 971 A.D. - 1030 A.D. (Sultan 998-1030), grandson of Alptigin
In c.999 Mahmud defeated his elder brother to gain control of Khorasan (in Iran) and of Afghanistan. He is said to have vowed to invade India once a year and he led about 17 such expeditions. His chief opponent in northern India was Jaipal, the ruler of the Punjab. In 1001, Mahmud marched on India with 15,000 horse troops and Jaipal met him with 12,000 horse troops, 30,000 foot soldiers, and 300 elephants. In a battle near Peshawar the Indians were defeated leaving behind 15,000 dead. Jaipal's son, Anandpal, appealed to the other Indian rajas for help and in 1008 the two forces met between Und and Peshawar. At a critical point in the battle, Anandpal's elephant, panic-stricken, took flight and the Indians, believing that their leader was running away, fled from the battlefield.
Mahmud transformed Ghazna into a great centre of art and culture. He patronized scholars, established colleges, laid out gardens, and built mosques, and palaces.
In 1024 the Sultan set out on his last famous expedition to the southern coast of Kathiawar along the Arabian Sea, where he sacked the city of Somnath and its renowned Hindu temple. The last years of his life were spent in fighting the Central Asian tribes threatening his empire.