Mahmud of Ghazni and the Punjab province

Mahmud of Ghazni raided India seventeen times between 1001 and 1027. He defeated the Hindu Shahi rulers Jayapala and Anandapala, who held the country between Kabul and the Chenab, and annexed the Punjab.

Punjab was then a province of the Ghaznavid empire for over 150 years, governed from Lahore, which became a major city under that administration. When the Oghuz Turks took Ghazni itself in the early 1160s, Lahore became the Ghaznavid capital until the Ghurids captured it in 1186.

That period is when Lahore acquires the shrine of Data Ganj Bakhsh, Ali Hujwiri, an eleventh-century Sufi whose Kashf al-Mahjub is the earliest Persian treatise on Sufism. His shrine is the largest in Pakistan by attendance.

Punjab therefore had a settled Muslim administration for a century and a half before the Delhi Sultanate existed, which is why the region's Islamic institutions are older than northern India's.

Masud Sad Salman, writing Persian poetry at Lahore in this period, is sometimes claimed as the first Indian poet in Persian and possibly in Hindavi.

The Hindu Shahi kingdom he broke had held the passes out of Kabul for two centuries, with its capital at Hund on the Indus and later at Nandana in the Salt Range. Nandana's fort and temple stand in Jhelum district and are among the very few Shahi buildings left anywhere.

Al Biruni travelled with these campaigns and wrote the Kitab al Hind, the first serious external description of Indian learning by anybody, out of Sanskrit he learned in the Punjab. The most valuable thing to come out of the invasions was a book written by a scholar attached to the army.

Nothing of the Ghaznavid city survives at Lahore. The fort has Mughal work standing on earlier layers and the excavation inside it has reached pre Mughal levels without producing a plan of what was there. A capital of a century and a half lies under a later capital and has never been properly dug.

What we don't know

  • Whether the Hindavi verse attributed to Masud Sad Salman existed. The claim is old and the texts are lost.

Where to check this

Named but not linked. These are real, findable documents. This project has not consulted them for this page.

  • Ali Hujwiri, Kashf al-Mahjub.

This page has not yet been read through by the editor. Treat it with more caution than the rest.

How this page was written. The text is compiled from the standard published histories and reference works, not from a document held in hand. Nobody from this project has visited the place or read the archive. The list above is where a reader can go to check it, not a record of what was consulted line by line. Dates and figures are the received account. If you hold something better, write in and it will be corrected.

This is one of 65 accounts in Before the Gurus, the chapter of this site covering the region before 1469, from the Indus cities to the Lodhis.