In 962, Alp Tigin, a Turkish ghulam or slave soldier, who rose to be the commander of the army in Khorasan in the service of the Samanids, seized Ghazna and set himself up as a ruler there. A successor Sebuk Tigin started to expand vigorously his domain, first capturing Kandahar, then began a struggle with the Hindu Shahi kingdom.[1] The Hindu Shahi ruler Jayapala attacked Sebuk Tigin, but was defeated, then again later when his army of a reported size of over 100,000 was beaten.[2] Lamghan was plundered, and Kabul and Jalalabad were annexed by the Ghaznavids. In 997, Mahmud ascended the throne at Ghazni, and vowed to invade India every year until the northern lands were his.[3] In 1001 he arrived at Peshawar with a select group of 15,000 cavalry, and a large corps of ghazis and Afghans.[1]