Jaipala, the Shaka king who ruled parts of Afghanistan and Punjab, was the first Indian ruler to face Mahmud of Ghazni's invasion in 1001 CE. Jayachandra of Gahadavala dynasty fought Muhammad Ghori, not Mahmud of Ghazni, while Prithvi Raj Chauhan also faced Ghori, not Mahmud.