For 17 times, he attacked India during the period between 1000 and 1027 AD, a significant event in the history of India.
Mahmud of Ghazni first invaded modern Afghanistan and Pakistan in 1000 AD. He defeated Hindu shahi kingdom ruler Jaya Pala, who killed himself later, and his son Ananda Pala became his successor.