Ghaznavid Invasions of India
غزوات الغزنويين للهند
# Mahmud of Ghazni: The Sword of Islam and the Gateway to India
The Ghaznavid Dynasty and Its Origins
The Ghaznavid state emerged from the dissolution of Samanid authority in Central Asia in the late 4th century AH. The Ghaznavids were originally Turkic military commanders who served the Samanid rulers as provincial governors and military officers. Sabuktegin, the father of Mahmud, served as governor of Ghazni (in modern Afghanistan) under Samanid overlordship and gradually expanded his independent authority. Upon his death in 387 AH / 997 CE, his son Mahmud seized control of the Ghaznavid territories and began the process of building one of the most powerful Islamic states of the medieval period.
Mahmud was the first ruler in Islamic history to take the title "Sultan" — a title indicating a ruler who exercises actual political and military power, distinct from the Caliph who holds religious-legal authority. The Abbasid Caliph al-Qadir bi-Allah in Baghdad recognized Mahmud's sultanate and granted him formal legitimacy. In exchange, Mahmud became the most zealous champion of Sunni Islam against its enemies — both external and internal — presenting his military campaigns as acts of religious service.
The First Among the Faithful: Mahmud as Defender of Sunni Orthodoxy
Mahmud's ideological self-presentation was consistently framed in terms of religious duty. He received from the Abbasid Caliph the title "Yamin al-Dawla wa Amin al-Milla" (Right Hand of the State and Trusted One of the Community) and leveraged his campaigns against Hindu kingdoms as jihad — the expansion of the territory under Islamic governance. His court historian al-Utbi's "Tarikh al-Yamini" (History of Yamin al-Dawla) presents the Indian campaigns entirely through this religious lens: Mahmud as the warrior of Islam bringing the light of tawhid to the darkness of polytheism.
Within the Islamic world, Mahmud also fought against the Ismaili Shia Qarmatians and against the Buwayhid Shia rulers who had dominated the Abbasid Caliphate in Baghdad. He expelled the Shia rulers from Khorasan and Ray, and his stated commitment to Sunni orthodoxy was a central element of his political legitimacy. The Caliph in Baghdad depended on Mahmud's military power to protect the remnants of Abbasid authority from Shia dynasties; Mahmud depended on the Caliph's religious legitimacy to frame his conquests as holy war.
Seventeen Campaigns into the Indian Subcontinent
Between 392 AH / 1001 CE and 416 AH / 1026 CE, Mahmud conducted approximately seventeen military campaigns into the Indian subcontinent. These campaigns represent the most sustained military engagement with India by any Islamic ruler up to that point and permanently altered the religious and political geography of South Asia.
The campaigns targeted different regions in different years:
Punjab and Sind: Mahmud's earliest campaigns focused on the territories of Punjab and Sind, which had been partially under Muslim rule since the Umayyad general Muhammad ibn al-Qasim's conquest of Sind in 92 AH / 711 CE. Mahmud extended and consolidated Muslim control over these areas, making Lahore a major center of Islamic culture and administration. The Persian poet Masud Sa'd Salman, who wrote poetry in Persian and Punjabi in the Ghaznavid period, is evidence of the sophisticated Islamic literary culture that developed in Punjab under Mahmud's patronage.
The Gangetic Plain: Several campaigns reached deep into northern India, targeting the wealthy temple cities of the Gangetic plain. The Hindu Shahi kingdom of Kabul and the Rajput confederacies of Rajasthan and Gujarat were the principal military opponents.
The Destruction of Somnath (416 AH / 1026 CE): The most famous and most debated of Mahmud's campaigns was his attack on the Somnath temple in Gujarat, on the Kathiawad peninsula on the Arabian Sea coast. Somnath was one of the wealthiest and most revered Hindu temples in India — the Shiva lingam it housed was considered among the holiest objects in Hinduism, and offerings from across India had made it extraordinarily rich. Mahmud attacked in the winter of 416 AH, broke through the temple's defenses, and looted treasure that later historians valued in the millions of dinars. The temple idol was shattered and the stones reportedly sent to Ghazni, where they were placed as steps in the entrance to the Friday mosque — a deliberate act of religious triumphalism.
Al-Biruni and the Understanding of India
One of the most significant consequences of Mahmud's Indian campaigns was entirely intellectual rather than military. Mahmud brought back to Ghazni among his captives and clients the Persian scholar Abu Rayhan al-Biruni (362-440 AH / 973-1048 CE) — arguably the greatest scholar of the medieval Islamic world and perhaps the most universal genius between Aristotle and Leonardo da Vinci.
Al-Biruni spent years in India, learning Sanskrit and immersing himself in Indian philosophy, religion, mathematics, and natural science. The result was "Kitab al-Hind" (The Book of India), completed approximately 423 AH / 1031 CE. This work is without peer as an account of Indian civilization written by a medieval scholar. Al-Biruni explained Hindu philosophy, cosmology, and religion with remarkable accuracy and unusual empathy — explicitly comparing Indian and Greek philosophical traditions and noting parallels that later scholars have confirmed.
Al-Biruni's "Kitab al-Hind" contains the earliest accurate description of India's caste system, detailed accounts of Hindu astronomical and mathematical achievements, and a comparative analysis of Indian and Islamic religious practice. It was written with a degree of scholarly objectivity that was unusual in any medieval culture. Al-Biruni expressed admiration for Indian mathematical and astronomical achievements — the Indian numeral system, the zero, trigonometric functions — even as he disagreed with Hindu theological positions.
This scholarly enterprise, conducted under Mahmud's patronage and made possible only by the access to India that Mahmud's campaigns provided, is one of the greatest acts of cross-civilizational intellectual engagement in the medieval world.
The Gateway to India: Long-Term Consequences
The historical significance of Mahmud's campaigns extends far beyond the immediate military and financial gains. By establishing Muslim political authority in Punjab and consolidating the Ghaznavid presence in northern India, Mahmud opened the pathway through which Islam would eventually become one of India's two major religions.
The Delhi Sultanate (founded 602 AH / 1206 CE by Qutb al-Din Aibak, another Ghaznavid-descended Turkic commander) extended Muslim rule across most of northern India. The Mughal Empire (founded 932 AH / 1526 CE) brought a cultural and political synthesis of Islamic and Indian civilization that produced some of the greatest art, architecture, and literature in world history. The two hundred million Muslims of the Indian subcontinent today trace the roots of their Islamic heritage in part to the pathway that Mahmud's campaigns opened.
Lahore, which Mahmud developed as a major administrative and cultural center, became one of the great cities of the Islamic world. Data Ganj Bakhsh (Ali Hujwiri), one of the greatest early Sufi teachers in the subcontinent, settled in Lahore and is buried there — his shrine remains the most visited in Pakistan. The cultural Islamization of Punjab, Sind, and ultimately much of northern India proceeded gradually over centuries after Mahmud's political conquests.
The Scholarly Debate: Religion, Politics, and Financial Calculation
Modern historians have debated at length the relative weight of religious motivation versus political calculation and financial opportunism in Mahmud's campaigns. The enormous wealth extracted from Hindu temples — particularly Somnath — was undeniably a powerful incentive. Mahmud used this wealth to build Ghazni into one of the great cities of the Islamic world, constructing mosques, madrasas, libraries, and palaces.
The court poet Firdausi dedicated his Shahnameh (Epic of Kings) to Mahmud — though their relationship ended badly when Mahmud failed to provide the promised reward. The historian al-Utbi, the poet al-Asjadi, and others made Mahmud's court a center of Persian literary culture. The wealth extracted from India funded this extraordinary cultural flowering.
Classical Islamic sources celebrate Mahmud unambiguously as a champion of Islam. Al-Utbi's Tarikh al-Yamini, the primary contemporary source, presents every campaign as divinely guided holy war. Modern historians — Indian, Pakistani, Western, and otherwise — have examined the same evidence and offered more complex interpretations.
The Ahl us-Sunnah position on these campaigns reflects a principled distinction: the expansion of Islamic political authority and the opening of territories to Muslim settlement and da'wah are understood as legitimate aims of Muslim rulers. The destruction of temples and idols associated with polytheistic worship has Quranic and prophetic precedent in the destruction of the idols of Mecca after the Fath (conquest). At the same time, the deliberate targeting of civilian populations, theft beyond military necessity, and destruction driven by personal greed rather than religious principle are not sanctioned by Islamic law of war, and later scholars have noted these distinctions in their evaluation of Mahmud's campaigns.
What cannot be disputed is Mahmud's importance to the history of Islam in South Asia. He planted the seed from which the Islamic civilization of the subcontinent grew.
Sources:
- Al-Utbi, Tarikh al-Yamini (History of Yamin al-Dawla Mahmud)
- Al-Biruni, Kitab al-Hind (The Book of India), trans. Edward Sachau
- C.E. Bosworth, The Ghaznavids: Their Empire in Afghanistan and Eastern Iran (Edinburgh: Edinburgh University Press, 1963)
- Romila Thapar, Somanatha: The Many Voices of a History (London: Verso, 2004)
- Wink, André, Al-Hind: The Making of the Indo-Islamic World, Vol. 2 (Leiden: Brill, 1997)
- Finbarr Barry Flood, Objects of Translation: Material Culture and Medieval Hindu-Muslim Encounter (Princeton: Princeton University Press, 2009)
- Peter Hardy, "Mahmud of Ghazna and the Historians," Journal of the Panjab University Historical Society 14 (1960)
For the Prophetic era, see the Seerah timeline .