Mahmud of Ghaznavid defeats the Hindu Shahis

Mahmud's first campaign to the south was against the Ismaili Fatimid Kingdom at Multan in a bid to curry political favor and recognition with the Abbassid Caliphate engaged with the Fatimids elsewhere.

Raja Jayapala of the Hindu Shahi Dynasty in modern-day Pakistan (Lahore and Kashmir) at this point attempted to gain retribution, for an earlier military defeat at the hands of Mahmud's father, who controlled Ghazni in the late 980s, that had lost him extensive territory. His son Anandapala succeeded him and continued the struggle, assembling a powerful confederacy which was defeated once more at Lahore in 1008 bringing Mahmud control of the Hindu Shahi dominions of Updhanpura.

There is considerable evidence from writings of Al-Biruni, Soghidan, Uyghur and Manichean texts that the Buddhists, Hindus and Jains were accepted as People of the Book and references to Buddha as Burxan or as a prophet can be found. After the initial destruction and pillage, Buddhists, Jains and Hindus were granted protected subject status as Dhimmis. By that time, however, most of the centers of buddhist and Hindu learning were already destroyed.