Rise of Ghazni – Alptigin to subuktigin.
Alptigin, one of the Turkish slaves of the samanid ruler, Abdul Malik, rose to the status of governor of khurasan.
However, when his patron died, he was stripped of his title and forced to leave the land. He captured a small area in Afghanistan and established his rule in the city state of Ghazni in 962 with the aim of conquering his own land, a desire that remained in the hearts of his successors.
After his death in 977,he was succeeded by his son-in-law subuktigin under whose rule, Ghazni soon emerged as a political and military power of the region.
Misadventure of Raja Jaipal.
Alarmed at the rising power in the neighborhood, the Hindu Shahi Raja Jaipal attacked Ghazni. Jaipal was defeated. In order to save his life, he promised to pay tribute. But after going back home, he not only defaulted but also took support from other hindu rajas of the region and again attacked subuktigin in 991. His fate was not different this time of lamghan and peshawer.
Rise of Mahmud Ghaznavi.
Meanwhile, subuktigin died and his son Mahmud ascended the throne in 998, Jaipal took advantage of the situation, and to avenge his defeat at the hands of subuktigin, organized an army of 12,000 horsemen, 30,000 foot soldiers and 300 elephants. This movement forced Mahmud, who was preparing to invade central Asia, to turn his attention towards India.
The battle against Jaipal was the beginning of a long series of attacks by Mahmud against South Asia. According to the most historians, Mahmud invaded India 17 times to crush the power of the hindu rajas and maharajas who were always busy planning conspiracies against him. After defeating Tarnochalpal in 1021,Mahmud formally annexed Punjab. After the fall of Punjab, the hindu think tank assembled at somnath-which was more of a political centre than a temple to plan a big war against Mahmud. He took all the rajas and maharajas by surprise when he attacked somnath and crushed the hindu headquarters of political intrigue.