Go further with Improve your reading skill and discover the art, culture and history of Iran: $14.99, instant PDF download. See inside the book

Mahmud of Ghazni

Mahmud of Ghazni (971–1030) was the most powerful ruler of the Ghaznavid dynasty, sultan from 998 until his death. He led repeated raids into northern India, extended his rule across eastern and central Iran to Rey, and kept a brilliant Persian-speaking court; he is also remembered, mostly through later legend, as the patron who failed to reward Ferdowsi for the Shahnameh.

Persian miniature of Mahmud of Ghazni seated, receiving elephants brought as tribute from India
Mahmud of Ghazni receiving Indian elephants as tribute, from the Majma al-Tawarikh of Hafiz-i Abru, Herat, c. 1425, painted four centuries after his death. Image: 15th-century Herat painter (Worcester Art Museum), Public domain, via Wikimedia Commons.
Born2 October 971, Ghazni
Reigned998–1030
FatherSebuktigin, founder of the Ghaznavid state
TitlesYamin al-Dawla (“Right Hand of the State”), granted by the Abbasid caliph
Died30 April 1030, Ghazni
BuriedRawza, near Ghazni

Taking power

Mahmud was the son of Sebuktigin, a Turkish former slave soldier who had made himself ruler of Ghazni, and, according to tradition, of a mother from a landowning family of Zabulistan, which is why Persian writers sometimes call him Mahmud-e Zavoli. As a young man he commanded his father’s troops in Khorasan on behalf of the Samanids. When Sebuktigin died in 997 and left the throne to a younger son, Ismail, Mahmud fought his brother and won in 998.

The following year the Samanid state collapsed. Mahmud took Khorasan, received the title Yamin al-Dawla from the Abbasid caliph al-Qadir in Baghdad, and presented himself as a loyal Sunni servant of the caliphate. Later writers call him the first ruler to bear the title sultan; in his own day the word was used of him but was not yet the formal title it became under the Seljuks. The wider story of the dynasty is told on The Ghaznavid Empire.

The Indian campaigns

Later historians counted seventeen expeditions into India, a number that is traditional rather than exact. The early ones broke the power of the Hindu Shahi kings: Jayapala was defeated near Peshawar in 1001. Others struck Multan, then held by Ismaili rulers whom Mahmud treated as heretics, the temple town of Nagarkot (Kangra), Thanesar, and in 1018 Mathura and Kannauj on the Ganges plain.

The most famous raid, on the temple of Somnath on the coast of Gujarat in 1025–26, became a symbol for later generations. Persian and Arabic chroniclers celebrated it as a triumph of Islam and dwelt on the gold carried away. In modern India it has been remembered as a national wound. The historian Romila Thapar has shown how the meaning of the event changed in the telling over the centuries, and how little the earliest sources agree on details.

The raids were above all a source of wealth. Gold, jewels, slaves and elephants flowed to Ghazni and paid for Mahmud’s army, his buildings and his court. Only the Punjab, with Lahore, was brought under lasting Ghaznavid rule.

Wars in the west

Mahmud spent as much effort in Iran and Central Asia. He fought the Qarakhanid Turks across the Oxus, took Khwarazm in 1017, and in 1029 entered Rey, ending the rule of the Buyid prince Majd al-Dawla (see The Buyid Dynasty). According to later chroniclers he had Ismailis and others he considered heretics in Rey executed and their books burned, and wrote to the caliph boasting of it. His son Masud went on to take Isfahan in 1030.

One decision had long consequences. Around 1025 Mahmud allowed Oghuz Turkmen bands, followers of the Seljuk family, to cross into Khorasan to graze their herds, after arresting their leader Arslan Israil. Within fifteen years their kinsmen had taken the province from his son. The story continues in The Rise of the Seljuks.

Patron of poets and scholars

Mahmud’s court at Ghazni drew some of the leading writers of the Persian world. The poets Unsuri and Farrukhi wrote long odes in his praise that are still read as models of the form. The scholar al-Biruni came to Ghazni after the conquest of Khwarazm, probably not by choice, and used the Indian campaigns to study Sanskrit learning (see Al-Biruni). Poets, scholars and fine buildings were part of how a ruler of slave origin showed that he belonged among the great kings.

Ferdowsi and Mahmud: what is legend

Ferdowsi finished the final version of the Shahnameh around 1010 and dedicated it to Mahmud, with verses praising him. That much is in the poem itself. What happened next is known almost only from stories written down long afterwards.

The fullest early version is in the Chahar Maqala (“Four Discourses”) of Nizami Aruzi, written around 1156, well over a century after both men had died. In his telling Mahmud, turned against the poet by courtiers who called him a heretic, sent a payment Ferdowsi found insulting. Ferdowsi went to the bathhouse and split the money between the bath attendant and a seller of drinks, then fled and wrote a satire against the sultan. Years later Mahmud regretted it and sent a rich gift to Tus, but as the camels entered one city gate, Ferdowsi’s body was being carried out of another. Later versions add the famous detail that Mahmud had promised a gold coin for every verse and paid in silver.

Historians treat the story with caution. The satire that circulates in some Shahnameh manuscripts is widely thought to be at least partly the work of later hands. Possible reasons for Mahmud’s coolness, such as Ferdowsi’s Shi’a sympathies or the poem’s celebration of pre-Islamic Iranian kings, are guesses. It is not certain that Mahmud ever read the poem. More on the poet is on Ferdowsi and the Shahnameh, and his grave is described on Tomb of Ferdowsi.

Ayaz and the Mahmud of literature

Mahmud lives on in Persian poetry less as a conqueror than as a character. His devotion to Ayaz, a slave who became one of his officers, turned into a stock theme for poets such as Attar and Rumi, who used the pair to write about love, loyalty and the relation between a master and a servant, or God and the soul. In these stories Mahmud is sometimes a wise king and sometimes a proud one corrected by others.

Death and reputation

Mahmud died at Ghazni in April 1030, aged 58, and was buried in a garden that became his tomb at Rawza, outside the city. His empire was larger than it was solid. Within ten years his son had lost Khorasan and all of Iran. In 1842 a British army carried off a pair of wooden doors from his tomb, claiming they were the gates of Somnath; scholars soon showed they were not.

Persian words from this page

محمود غزنویMahmud-e GhaznaviMahmud of Ghazni
ایازAyâzAyaz
فردوسیFerdowsiFerdowsi
شاهنامهShâhnâmehBook of Kings
سومناتSumenâtSomnath
چهار مقالهChahâr MaghâlehFour Discourses

For a collection of the poet’s lines, see Ferdowsi quotes; for the epic itself, the Shahnameh.

Sources and further reading

  • Nizami Aruzi, Chahar Maqala, trans. E. G. Browne (London, 1921).
  • C. E. Bosworth, The Ghaznavids: Their Empire in Afghanistan and Eastern Iran, 994–1040 (Edinburgh, 1963).
  • Muhammad Nazim, The Life and Times of Sultan Mahmud of Ghazna (Cambridge, 1931).
  • Romila Thapar, Somanatha: The Many Voices of a History (New Delhi, 2004).
  • Encyclopaedia Iranica, “Ghaznavids” (C. E. Bosworth).

Want to learn Persian? Get the free Starter Pack

Get the 14-page printable Starter Pack (all 32 letters, a 7-day reading plan, 100 core words and 20 survival phrases) and a short 5-email course. Free.

Become a tutor