977 CE
West Asia · Empire

Ghaznavid Empire

977 – 1186 CE

Overview

Persianate Sunni Muslim empire of Turkic ghulam (military slave) origin, founded by Sabuktigin at Ghazni (modern Afghanistan) in 977 CE as the Samanid empire fragmented. Under Mahmud of Ghazni (r. 998-1030) — the first ruler to use the title Sultan — the dynasty reached its peak extent from the Oxus River to the Punjab, conducting 17 famous raids into India (1000-1027) including the celebrated sack of the Somnath Temple (1025). Al-Biruni composed his landmark ethnography of India (Tahqiq ma li-l-Hind) while accompanying these campaigns, and Ferdowsi completed the Shahnameh at Mahmud's court, making Ghazni the leading cultural center of the Islamic east. The Battle of Dandanaqan (1040) stripped all of Khorasan and Iran to the Seljuks; Ibrahim ibn Masud (r. 1059-1099) stabilized the reduced realm through a peace treaty with the Seljuks and forty years of stable Punjab-focused rule. The Ghurid sack of Ghazni (1151) ended the capital's function; Khusrau Malik, the last sultan, was captured and executed when Muhammad of Ghor took Lahore in 1186, extinguishing the dynasty.

Ghaznavid Empire

Persianate Sunni Muslim empire founded by Sabuktigin, a Turkic former military slave (ghulam) of the Samanid empire who consolidated control of Ghazni (modern Afghanistan) in 977 CE. Under Mahmud of Ghazni (r. 998–1030) the dynasty reached its peak extent — from the Oxus River to the Punjab — while conducting 17 famous raids into India and hosting one of the greatest Persian literary courts of the medieval period (Ferdowsi, al-Biruni). The Battle of Dandanaqan (1040) ended Ghaznavid control of Khorasan; the Seljuks absorbed all western territories. The dynasty survived as a reduced Afghan-Punjab state until Ghurid forces sacked Ghazni (1151) and finally extinguished the dynasty by capturing Lahore and executing the last sultan Khusrau Malik in 1186.

Territory Phases

  1. Ghaznavid Empire (Founding)977 CE997 CE

    Sabuktigin (r. 977–997), a former Turkic ghulam (military slave) of the Samanid empire, consolidates control of Ghazni after Alp Tigin's death (c. 963) and outlasting several intervening rulers; the soldiers elect him amir of Ghazni in 977. As the Samanid state fragments under Qarakhanid and Buyid pressure, Sabuktigin expands autonomously into the Sulaiman Mountains and makes the first significant raids toward the Hindu Shahi territories (capturing Peshawar 988). The Ghaznavid core is the Ghazni highlands of eastern Afghanistan, with expanding control of Khorasan south of the Oxus and border regions of modern Pakistan. Sabuktigin receives nominal Samanid recognition as governor but operates as a de facto independent ruler, reforming the military and patronizing a Persian-language court that would become the template for all subsequent Ghaznavid rule.

  2. Ghaznavid Empire (Mahmud — Peak)998 CE1030 CE

    Mahmud of Ghazni (r. 998–1030) transforms the Ghaznavid state from a regional power into one of the largest Islamic empires of its era. He launches 17 expeditions into India between 1000 and 1027, sacking Mathura, Kannauj (1018–1019 — effectively ending Gurjara-Pratihara central authority), and most famously the Somnath Temple (1025). Western conquests include Khorasan (fully absorbed by 1004), Sistan, the Ghaznavid-Buyid wars culminating in Rayy (1029), and the Oxus as the northern frontier. Permanent Ghaznavid rule is confined to the Punjab east of the Indus; the Indian raids are revenue-extraction campaigns, not territorial annexations into the Ganges plain. Mahmud receives the Abbasid caliph's laqab Yamin al-Dawla and is recognised as a champion of Sunni orthodoxy. His court at Ghazni becomes the leading cultural center of the Islamic east: Ferdowsi's Shahnameh (c. 1010), Biruni's Tahqiq ma li-l-Hind (c. 1017–1030), and patronage of Unsuri, Farrukhi, and Masud Saad all date to this reign. The two remaining Ghaznavid minarets at Ghazni survive as testimony to the architectural florescence.

  3. Ghaznavid Empire (Post-Dandanaqan)1030 CE1059 CE

    Following Mahmud's death (1030), succession struggles and the decisive Battle of Dandanaqan (1040) — in which Masud I is crushingly defeated by Seljuk Tughril Beg — strip away all of Khorasan, Iran, and Central Asian territories. The empire contracts rapidly to eastern Afghanistan (Ghazni, Kabul, Bost, Kandahar) and the Punjab. Masud I's reign (1030–1041) is documented in unparalleled detail by Bayhaqi's chronicle; after the defeat he is deposed, imprisoned at the fort of Giri, and killed there. A succession of short-reigned rulers follows (Mawdud 1041–1048, Abd al-Rashid 1049–1052, Farrukhzad 1052–1059) before Ibrahim takes the throne. Despite territorial contraction, the Ghaznavid court at Ghazni retains its cultural prestige, and the Punjab revenues sustain the dynasty.

  4. Ghaznavid Empire (Ibrahim Recovery)1059 CE1099 CE

    Ibrahim ibn Masud (r. 1059–1099) rules for forty years — the longest single reign in Ghaznavid history — and is the dynasty's last period of real stability. His peace treaty with the Seljuks (c. 1060) formally recognizes the Oxus as the boundary between the empires and ends the military threat from the west. Ibrahim focuses on Punjab revenues, which fund a culturally rich court and periodic Indian campaigns. He is known for religious tolerance and for patronizing Persian literature, earning the epithet Zahir al-Dawla. The truncated empire — Afghanistan east of the Ghor highlands plus the Punjab plains — is stable and prosperous during his reign, insulated from Seljuk pressure by the treaty.

  5. Ghaznavid Empire (Bahram Shah Vassalage)1099 CE1157 CE

    After Ibrahim's death (1099), three rulers reign in rapid succession: Masud III (1099–1115), Shir-Zad (1115–1116), and Arslan Shah (1116–1117) before Bahram Shah (r. 1117–1157) stabilizes the throne with Seljuk support. The Ghaznavids are now effectively a Seljuk vassal state; Bahram Shah acknowledges Seljuk suzerainty explicitly. The catastrophic event of this phase is the sack of Ghazni (1151) by the Ghurid ruler Ala al-Din Husayn "Jahan-soz" (World-Burner), who burned the city for seven days in revenge for the poisoning of his brother Qutb al-Din Muhammad by Bahram Shah and the crucifixion of another brother, Sayf al-Din Suri. Ghazni never fully recovers as a functioning capital. The Ghaznavids retain control of the Punjab and pockets of eastern Afghanistan but the Ghurid threat from the west continuously erodes their position.

  6. Ghaznavid Empire (Lahore Terminal Phase)1157 CE1186 CE

    The terminal phase of the Ghaznavid dynasty. Following the definitive Ghurid occupation of Ghazni, the capital is permanently relocated to Lahore by 1163 under Khusrau Shah. Khusrau Malik (r. 1160–1186), the last sultan, controls only the Punjab plains and nominal suzerainty over some eastern territories. The Ghurids under Muhammad of Ghor besiege Lahore in 1186; Khusrau Malik surrenders and is imprisoned, then executed by the Ghurids. The Ghaznavid dynasty is extinguished after over two centuries; the Punjab is absorbed into the rapidly expanding Ghurid empire, which will soon extend across all of North India.

Key Rulers

Sabuktigin

Amir of Ghazni

Also known as: Sebüktigin, Nasir ud-Din Sabuktigin

977 CE – 997 CE

★★★

Founder of the Ghaznavid dynasty. A Turkic ghulam (military slave) who rose to command Ghazni after the death of his master Alp Tigin; he consolidated his position by c. 977 CE, formally asserting Ghaznavid autonomy as Samanid power declined. Conducted the first Ghaznavid raids toward the Hindu Shahi territories, captured Peshawar (988), and expanded into the Sulaiman Mountain passes. The administrative and military framework he established became the template for his son Mahmud's imperial expansion.

Mahmud of Ghazni

Sultan, Yamin al-Dawla, Amin al-Milla

Also known as: Maḥmūd, Yamin ad-Dawlah Mahmud, Mahmud Ghaznavi

998 CE – 1030 CE

★★★

The defining ruler of the Ghaznavid dynasty; transformed a regional Afghan chieftainship into a major Islamic empire. Conducted 17 famous expeditions into India between 1000 and 1027, sacking Mathura, Kannauj (1018–1019), and the Somnath Temple (1025) and accumulating vast treasures that funded a brilliant Persian court. Received from the Abbasid caliph the title Yamin al-Dawla ("Right Hand of the State") — the first Turkic ruler to use the title Sultan. Conquered Khorasan, Sistan, and briefly the Buyid western Iran (Rayy 1029). At his court Ferdowsi completed the Shahnameh and al-Biruni conducted his researches into Indian philosophy and science.

Masʿud I

Sultan

Also known as: Masud I, Shihab ad-Dawlah Masud

1030 CE – 1041 CE

★★

Son of Mahmud; suffered the catastrophic Battle of Dandanaqan (1040) in which Seljuk Tughril Beg defeated and routed the Ghaznavid army, leading to the permanent loss of Khorasan and all Iranian territories. His reign is documented in extraordinary detail by Bayhaqi's chronicle (Tarikh-i Bayhaqi), which serves as the primary source for Ghaznavid history of this period. After the defeat, Masud I was deposed by mutinying troops, imprisoned at the fort of Giri, and killed there on orders of his brother Muhammad (whom he had earlier blinded).

Mawdud

Sultan

Also known as: Mawdud ibn Masud, Shihab ad-Dawlah Mawdud

1041 CE – 1048 CE

★★

Son of Masud I; seized the throne and stabilized the reduced Ghaznavid realm after the Dandanaqan catastrophe. His reign marked the consolidation of the post-Dandanaqan order, focusing Ghaznavid energy on the eastern territories (Ghazni core and Punjab) rather than attempting to reconquer Khorasan. Died before he could mount any serious western counteroffensive.

Abd al-Rashid

Sultan

Also known as: Abd al-Rashid ibn Mahmud, Izz ad-Dawlah

1049 CE – 1052 CE

Son of Mahmud; ruled briefly amid succession instability. Assassinated c. 1052 CE during a period of court intrigues. His short reign illustrates the dynastic fragility of the post-Dandanaqan period before Ibrahim restored stability.

Farrukhzad

Sultan

Also known as: Farrukhzad ibn Masud

1052 CE – 1059 CE

Son of Masud I; briefly consolidated the realm before Ibrahim's long and stable reign. Farrukhzad managed to suppress the succession instability that had characterized the 1041–1052 period and conducted some campaigns in the Indian borderlands, bridging between the chaos following Dandanaqan and Ibrahim's forty-year stabilization.

Ibrahim ibn Masʿud

Sultan, Zahir al-Dawla

Also known as: Ibrahim, Zahir ad-Dawlah Ibrahim

1059 CE – 1099 CE

★★★

The longest-reigning Ghaznavid sultan (r. c. 1059–1099) and architect of the dynasty's second period of stability. Ibrahim negotiated a peace treaty with the Seljuks c. 1060, formally recognizing the Oxus as the frontier and ending western military pressure. He focused on Indian revenues from the Punjab, maintained a culturally rich court at Ghazni, and is noted for religious tolerance and literary patronage. His reign earned him the title Zahir al-Dawla ("Defender of the State") and a reputation as a just ruler in later Persian historical writing.

Masʿud III

Sultan

Also known as: Masud III ibn Ibrahim

1099 CE – 1115 CE

Son of Ibrahim; ruled for approximately 16 years following his father's death. His reign maintained the stable reduced empire inherited from Ibrahim but faced increasing Seljuk pressure and the emergence of the Ghurid threat from the Afghan highlands. Notable as the builder of the Masʿud III palace at Ghazni, excavated by Italian archaeologists and yielding fine carved marble panels now in the Kabul Museum.

Bahram Shah

Sultan

Also known as: Bahram Shah ibn Masud III, Yamin ad-Dawlah Bahram Shah

1117 CE – 1157 CE

★★

Son of Masud III; longest-reigning sultan of the Bahram Shah phase and the last Ghaznavid to rule from Ghazni as effective capital. Maintained his throne with Seljuk support and acknowledged Seljuk suzerainty. The catastrophic event of his reign was the sack of Ghazni (1151) by Ghurid ruler Ala al-Din Husayn "Jahan-soz", who burned the city for seven days in revenge for the poisoning of his brother Qutb al-Din Muhammad and the crucifixion of Sayf al-Din Suri. Bahram Shah recaptured Ghazni but the city was permanently weakened as a capital.

Khusrau Malik

Sultan

Also known as: Khusrau Malik ibn Khusrau Shah, Taj ad-Dawlah Khusrau Malik

1160 CE – 1186 CE

Last sultan of the Ghaznavid dynasty. Ruled from Lahore after the permanent loss of Ghazni to the Ghurids; Lahore became the de facto capital by 1163. His reign was spent attempting to stave off the Ghurid advance, including an alliance with the Khokhar tribe. Besieged by Muhammad of Ghor at Lahore (1186), Khusrau Malik surrendered and was imprisoned; he was later executed by the Ghurids, extinguishing the Ghaznavid dynasty.

Key Events

Founding of Ghaznavid Rule under Sabuktigin977 CE

Ghazni, Afghanistan

Sabuktigin, a Turkic ghulam of the Samanid commander Alp Tigin, consolidates control of Ghazni c. 977 CE after Alp Tigin's death and establishes the Ghaznavid dynastic line. Beginning as a Samanid vassal governor, Sabuktigin rapidly builds an independent military force, reforms the army on a professional ghulam model, and begins eastward expansion toward the Hindu Shahi border. The founding marks the emergence of the first major Turkic imperial dynasty in Central Asia with a Persianate court culture.

Completion of the Shahnameh at Mahmud's Court1010 CE

Ghazni, Afghanistan

Ferdowsi (Abu'l-Qasim Ferdowsi Tusi) presents his epic Persian poem the Shahnameh ("Book of Kings") at Mahmud of Ghazni's court, c. 1010 CE. The work — approximately 50,000 couplets — recounts the legendary and historical kings of Iran from mythological times to the Arab conquest; it is the foundational text of New Persian literature and became the basis of Iranian national identity. The relationship between Ferdowsi and Mahmud is celebrated but contested: later Persian tradition holds that Mahmud rewarded the poet poorly, though the historicity of this account is debated.

Al-Biruni's Indian Research (Tahqiq ma li-l-Hind)1017 CE

Ghazni / Punjab frontier

Abu Rayhan Muhammad ibn Ahmad al-Biruni accompanies Mahmud's Indian campaigns beginning c. 1017 CE and conducts systematic research into Indian philosophy, mathematics, astronomy, and social customs. His resulting work — Tahqiq ma li-l-Hind ("Researches into India", commonly titled Kitab al-Hind or Indica) — is one of the most rigorous and empathetic ethnographic accounts of South Asia produced in the medieval period. Al-Biruni learned Sanskrit and critically assessed Indian scientific texts; the work documents a level of cross-civilizational scholarly engagement remarkable for the era.

Raid on the Somnath Temple1025 CE

Somnath, Gujarat, India

Mahmud of Ghazni leads his most famous Indian expedition to the Somnath Temple (Somanatha), a wealthy Shaivite sanctuary on the Gujarat coast. The temple's famous jyotirlinga is destroyed and the accumulated treasures — reportedly enormous — are carried back to Ghazni, funding the cultural projects of Mahmud's court. The raid became the most symbolically charged event in medieval Indian historical memory: cited by later Islamic chroniclers as the pinnacle of Mahmud's jihad, and in modern historiography as a focus of controversy regarding religious versus economic motivations.

Battle of Dandanaqan1040 CE

Dandanaqan, near Merv (modern Turkmenistan)

Masud I of Ghazni is decisively defeated by Seljuk forces under Tughril Beg and Chaghri Beg at Dandanaqan (near modern Merv). The Ghaznavid army is routed; Masud retreats toward India and is subsequently deposed and killed at the fort of Giri. The battle immediately ends Ghaznavid sovereignty over Khorasan, Gorgan, Tabaristan, and all of western Iran — territories that pass permanently to the Seljuks. Dandanaqan is the pivotal turning point of Ghaznavid history; after it, the dynasty is confined to eastern Afghanistan and Punjab for the remainder of its existence.

Peace Treaty with the Seljuks1060 CE

Afghanistan / Khorasan borderlands

Ibrahim ibn Masud negotiates a lasting peace with the Seljuk sultan, formally recognizing the Oxus River as the boundary between the two empires. The treaty ends the major western military threat and allows the Ghaznavids to stabilize their truncated domain centered on Ghazni and the Punjab. Ibrahim's subsequent forty-year reign of stability is made possible by this diplomatic settlement; Ghaznavid energies are redirected toward Indian revenues and internal cultural patronage.

Ghurid Sack of Ghazni1151 CE

Ghazni, Afghanistan

Ghurid Sultan Ala al-Din Husayn, nicknamed "Jahan-soz" (World-Burner), sacks and burns Ghazni for seven days in revenge for the poisoning of his brother Qutb al-Din Muhammad (by Bahram Shah) and the crucifixion of his brother Sayf al-Din Suri (after a failed retaliatory campaign). The city that had been the magnificent capital of Mahmud's empire — with its palaces, libraries, and mosques — is severely damaged. Only two minarets and the tombs of Mahmud and Masud I are reportedly spared. Bahram Shah recaptures the city, but Ghazni never fully recovers its role as a thriving capital; the event accelerates the Ghaznavid shift toward Lahore as their effective power base.

Fall of Lahore and End of the Ghaznavid Dynasty1186 CE

Lahore, Pakistan

Ghurid Sultan Muhammad of Ghor (Mu'izz ud-Din Muhammad bin Sam) besieges Lahore, the last Ghaznavid capital. Khusrau Malik surrenders and is taken prisoner; he is subsequently executed by the Ghurids. The fall of Lahore extinguishes the Ghaznavid dynasty after more than two centuries of rule and transfers the Punjab — gateway to the Ganges plain — to Ghurid control. Muhammad of Ghor will go on to defeat Prithviraj III at the Second Battle of Tarain (1192) and open North India to the Delhi Sultanate.

Related Civilisations

Sources

  1. Bosworth, C.E. (1963) The Ghaznavids: Their Empire in Afghanistan and Eastern Iran, 994-1040(The foundational modern monograph on the Ghaznavid Empire covering its formation under Sabuktigin through the Battle of Dandanaqan (1040). Primary reference for Mahmud's Indian campaigns, court culture, Khorasan administration, and the Samanid succession.)
  2. al-Utbi (c. 1020) Tarikh-i Yamini (Kitab-i Yamini)(Court history by al-Utbi, secretary to Mahmud of Ghazni; covers Sabuktigin's reign and early Mahmud up to c. 1020 CE. Standard reference edition: Cairo 1869. Essential primary source for Mahmud's Indian campaigns and the Somnath raid.)
  3. Gardizi (c. 1049) Zayn al-Akhbar(Historical compilation by Gardizi written c. 1049–1052 CE, covering geography and history of the Ghaznavid lands. Critical edition by Abd al-Hayy Habibi (Tehran, 1968). Key source for Sabuktigin and early Mahmud period.)
  4. Bayhaqi, Abu'l-Fadl Muhammad ibn Husayn (c. 1050) Tarikh-i Bayhaqi(Massive chronicle by Bayhaqi (995–1077), secretary at the Ghaznavid chancellery; covers Masud I's reign in exceptional detail (1030–1041) including the Dandanaqan defeat. Authoritative edition by Fayyaz (1945). Considered one of the finest prose works in Persian literature.)
  5. Bosworth, C.E. (1975) The Early Ghaznavids. In Cambridge History of Iran Vol. 4(Survey chapter on Ghaznavid origins and early development through the reign of Masud I. In R.N. Frye (ed.), The Cambridge History of Iran, Vol. 4: The Period from the Arab Invasion to the Saljuqs. Concise scholarly synthesis.)
  6. Anooshahr, Ali (2021) The Ghaznavid Empire of India(Recent article surveying Ghaznavid rule in India (Punjab governance, revenue extraction, relationships with local populations). Indian Economic and Social History Review 58(4): 441–476. DOI: 10.1177/00194646211041162. Covers late-phase Ghaznavid administration in the Punjab.)
  7. Bosworth, C.E. (2001) Ghaznavids. Encyclopaedia Iranica(Authoritative encyclopaedia article on the Ghaznavid dynasty by the leading Western scholar. Covers full dynasty chronology, ruler sequence, territorial phases, and cultural contributions. Published online 15 December 2001; updated editions available.)
  8. Minhaj-i-Siraj Juzjani (c. 1260) Tabaqat-i-Nasiri(The single most important primary source for the Ghurid period. Juzjani served at the Delhi Sultanate court and had firsthand knowledge of the Ghurid dynasty. Covers the full dynasty sequence, the North Indian campaigns, and the 1206 fragmentation. Standard English translation: H.G. Raverty, Bibliotheca Indica series (London: Gilbert & Rivington, 1881), 2 vols.)
  9. Bosworth, C.E. (1977) The Later Ghaznavids: Splendour and Decay, 1040–1186(Covers the Ghaznavid decline and the Ghurid rise in depth. Essential for the ghurid_rise phase: the sack of Ghazni by Ala ud-Din "Jahan-soz" (1150), the progressive Ghurid consolidation, and the 1186 defeat of Khusrau Malik at Lahore that transferred Punjab to Ghurid control.)