Between 1021 and 1186 Lahore was, for the first time in its history, the seat of a state. The Ghaznavids annexed the Punjab plain and governed it from the city; in their last decades, after losing Ghazni itself, Lahore was the only capital they had. Islam had reached Sindh three centuries earlier, but it is here that it becomes a permanent institutional presence in Punjab — with a court, a mint, a language of administration, and, in time, a saint's tomb that Punjabis of every background still visit.

Both faces of a silver dirham of Mahmud of Ghazni: Arabic inscription on one side, Sanskrit in the Sharada script on the other.
Silver dirham struck at Mahmudpur — Lahore — AH 418–419 (1027–28 CE). The Islamic declaration of faith appears in Arabic on one face and in Sanskrit, in the Sharada script, on the other.

Causes

Mahmud of Ghazni (r. 998–1030) built a large empire from a base in what is now eastern Afghanistan and raided the subcontinent repeatedly from about 1000 CE. Most of his targets were raided and left. The Punjab plain was different: from about 1021 it was annexed and administered as a permanent province, with Lahore as its centre. The reason is geographic — Punjab is the corridor between the Afghan highlands and the Gangetic plain, and whoever holds Ghazni must hold Lahore to use it.

The contested question, stated as contested

Mahmud is remembered in two incompatible ways: as a plunderer and iconoclast whose defining act was the sack of the temple at Somnath in 1025–26, and as the founder of a Persianate imperial culture in the north-west that shaped the region's language, poetry and administration for eight hundred years.

The coin

In AH 418–419 (1027–28 CE) the mint at Lahore — recorded on the coin itself as Mahmudpur — struck a bilingual silver dirham. One face carries the Islamic declaration of faith in Arabic. The other carries a rendering of the same declaration in Sanskrit, written in the Sharada script, using the word avatāra where the Arabic has “messenger.” Only two dated years of the issue are known and it was struck at Lahore alone. Its purpose is genuinely debated — conciliation, administrative necessity, propaganda, or simply the practical demands of a market that read Sharada. It resists every simple account of the period, which is why we have made it this article's image rather than a portrait of a ruler.

Why the script matters

Sharada is what the north-west wrote in before the Persian alphabet arrived, and palaeographers place it in the lineage from which the Landa merchant hands and, later, Gurmukhi descend. This single coin therefore carries the ancestor of the script family that becomes Gurmukhi on one face, and the script family that becomes Shahmukhi on the other — five hundred years before either script existed. The Sharada → Landa → Gurmukhi descent is mainstream palaeography and Well-established; the details of transmission are debated.

The city

Lahore under the Ghaznavids acquired a court culture in Persian. The poet Masʿūd Saʿd Salmān, born in Lahore, wrote there and later from prison; his habsiyyāt, prison poems, are among the earliest substantial Persian verse composed in the subcontinent.

Hujwiri

More consequential for Punjab than any Ghaznavid ruler was Ali Hujwiri (d. c. 1072–77), a Persian-born Sufi who settled in Lahore and wrote the Kashf al-Maḥjūb, “The Unveiling of the Veiled” — the earliest surviving treatise on Sufism in the Persian language. His shrine, Data Darbar, is among the most visited in South Asia.

The devotional line running from Hujwiri through Baba Farid to Bulleh Shah and Waris Shah is the vernacular, Punjabi-speaking face of Islam in this land — and it is the tradition from which a great deal of Punjabi poetry comes. It should not, however, be read as a justification of the conquest that preceded it. The conquest and the saint are two different histories that happen to share a century.

c. 1000–1021

Raid becomes annexation

Mahmud raids the subcontinent repeatedly; the Punjab plain alone is kept and administered as a province.

1027–28

The bilingual dirham

The Lahore mint — “Mahmudpur” — strikes silver in Arabic and in Sanskrit in the Sharada script.

c. 1072–77

Hujwiri dies at Lahore

The author of the Kashf al-Maḥjūb is buried in the city; the shrine becomes Data Darbar.

1163

Ghazni falls to the Ghurids

Lahore becomes the dynasty's sole capital.

1186

Muhammad of Ghor takes Lahore

The Ghaznavids end; power passes east to Delhi.

Aftermath

After the Ghurids took Ghazni in 1163, Lahore became the Ghaznavids' only capital. Muhammad of Ghor took the city in 1186 and ended the dynasty. Power then passed east to Delhi, and Lahore returned to being a great provincial city — until the Mughals made it a capital again four centuries later.

Long-term impact

Persian became the language of government in Punjab and stayed so, under successive dynasties, until the British replaced it in the 1830s. The Persianate register still shades formal Punjabi and Urdu. And Lahore's identity as a capital city — a thing it had not been before 1021 — begins here.

Modern place-names

Lahore, Punjab, Pakistan. Ghazni, Afghanistan. Mahmudpur is a mint-name on coinage, not a separate settlement; a trace survives in the Lahore locality of Mahmud Booti.