In 962, Alp-Tegin, a Turkic 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.
[3][2] The Hindu Shahi ruler Jayapala attacked the Ghaznavids, but was defeated, then again later when his army of a reported size of over 100,000 was beaten.
Jayapala avoided action for some time waiting for reinforcements, and Mahmud then took the decision to attack with swords, arrows, and spears.
Judging from the personal adornments taken off captured Hindus, Jayapala's army was not prepared for battle and thousands of children were taken captive as well.
Sir HM Elliot, a historian who worked with the East India Company, writes: Jayapala was bound and paraded, and a large ransom was paid for the release of members of his family.