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.

| Born | 2 October 971, Ghazni |
|---|---|
| Reigned | 998–1030 |
| Father | Sebuktigin, founder of the Ghaznavid state |
| Titles | Yamin al-Dawla (“Right Hand of the State”), granted by the Abbasid caliph |
| Died | 30 April 1030, Ghazni |
| Buried | Rawza, 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 Ghaznavi | Mahmud of Ghazni |
| ایاز | Ayâz | Ayaz |
| فردوسی | Ferdowsi | Ferdowsi |
| شاهنامه | Shâhnâmeh | Book of Kings |
| سومنات | Sumenât | Somnath |
| چهار مقاله | Chahâr Maghâleh | Four 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.
More in Ghaznavids, Seljuks and Khwarazmshahs (977–1231)
- The Ghaznavid Empire
- Mahmud of Ghazni
- The Rise of the Seljuks
- The Battle of Dandanaqan (1040)
- Tughril Beg Enters Baghdad
- Alp Arslan
- Seljuk Architecture: Tomb Towers and Caravanserais
- The Battle of Manzikert (1071)
- Malik Shah I
- The Seljuks of Kerman
- Nizam al-Mulk and the Siyasatnama
- The Seljuk Domes of Isfahan’s Jameh Mosque
- Omar Khayyam: Poet and Scientist
- Al-Ghazali
- Sana’i of Ghazni
- Hassan-i Sabbah and the Fortress of Alamut
- The Nizari Ismailis and the “Assassins” Legend
- Sultan Sanjar and the Qara Khitai
- The Battle of Qatwan (1141)
- Anvari and Seljuk Court Poetry
- Seljuk Decline and the Atabegs
- The Ghurids
- Attar of Nishapur
- Nizami Ganjavi
- The Khwarazmian Empire
- Ala al-Din Muhammad II
- The Otrar Incident (1218): How Khwarazm Provoked Genghis Khan
- Jalal al-Din Mingburnu