Middle Ages1025–1026

Mahmud of Ghazni and the Sack of Somnath Temple (1025)

Mahmud of Ghazni raided the Somnath temple in Gujarat in January 1026. The campaign, what medieval sources say, and how the event was remembered later.

1869 photograph of the ruined medieval Somnath temple at Prabhas Patan, a later rebuilding of the shrine Mahmud attacked, before the modern temple was built
1869 photograph of the ruined medieval Somnath temple at Prabhas Patan, a later rebuilding of the shrine Mahmud attacked, before the modern temple was built. Image: D. H. Sykes (1869 print); reproduction by Ms Sarah Welch (CC0), Wikimedia Commons
Contents

The sack of Somnath was a raid by Mahmud of Ghazni, ruler of an empire based in today’s Afghanistan, on the famous Hindu temple of Somnath on the coast of Gujarat. Mahmud set out in 1025 and took the temple in January 1026, breaking its sacred linga and carrying off vast treasure. The event became one of the most retold episodes in Indian history, and its meaning is still debated.

Background

Mahmud (reigned 998–1030) was the son of Sebuktigin, a Turkic military commander who founded the Ghaznavid dynasty at Ghazni. Mahmud built an empire stretching from eastern Iran to the Punjab and was recognised by the Abbasid caliph in Baghdad as a champion of Sunni Islam.

From about 1000 he led repeated campaigns into northern India; tradition counts 17. These raids targeted wealthy cities and temples such as Nagarkot, Thanesar, Mathura and Kannauj. They brought Mahmud gold, jewels, slaves and elephants that funded his armies and his court, and they won him prestige as a warrior of the faith.

Somnath, at Prabhas Patan on the Saurashtra coast, housed one of the most revered shrines of Shiva, counted among the twelve jyotirlingas. It was rich from pilgrims’ gifts and from the trade of its port, and it lay in the kingdom of the Chaulukya (Solanki) king Bhima I.

The campaign

According to the Persian and Arabic sources, Mahmud left Ghazni in October 1025 with a large army and marched by way of Multan. To cross the Thar Desert he gathered camels to carry water and supplies. He reached the Chaulukya capital of Anahilapataka (modern Patan), whose king, Bhima I, withdrew before him.

The army arrived at Somnath in January 1026. The temple’s defenders resisted, and the town was taken after fighting that lasted, in most accounts, two or three days. Later writers such as Ibn al-Athir put the number of defenders killed at about 50,000, a figure modern historians regard as unreliable.

Mahmud had the linga broken. Al-Biruni, a scholar at Mahmud’s court, wrote that its upper part was destroyed and that pieces were taken to Ghazni, where one was placed in the city’s hippodrome and another at the door of its main mosque, so that people would walk over them. The treasure seized was enormous; medieval writers give sums such as 20 million dinars, which should be read as an indication of great wealth rather than a precise count.

Mahmud’s return was difficult. To avoid Indian forces gathering against him, he went back through Sindh, where his army suffered in the desert and was harassed by local groups. He reached Ghazni in the spring of 1026.

Key people

  • Mahmud of Ghazni (971–1030): Ghaznavid sultan who led the raid, remembered in Persian literature as a model of the warrior king and in much Indian memory as a destroyer of temples.
  • Bhima I (r. c. 1022–1064): Chaulukya king of Gujarat, who avoided battle with Mahmud but survived the invasion and continued to rule for decades.
  • Al-Biruni (973–after 1050): scholar who travelled in Mahmud’s territories in India and wrote a detailed study of Indian religion and science, in which he criticised the destruction caused by the raids.
  • Farrukhi Sistani (died c. 1038): Persian court poet whose verses are among the earliest accounts of the campaign.

Motives

Historians have long debated what drove Mahmud. The traditional view, shaped by his court writers, presents him above all as a religious warrior destroying idols. Many modern historians stress the economic motive: Indian temples held great stores of gold and jewels, and the plunder paid for Mahmud’s wars in Central Asia and Iran against rivals such as the Karakhanids and the Buyids.

These motives were not exclusive. Victories over famous temples won Mahmud prestige among Muslim rulers and the caliph, while the wealth they produced kept his armies loyal. Somnath, as one of the most celebrated shrines in western India, offered both riches and renown.

Mahmud did not try to annex Gujarat. Apart from the Punjab, which became a Ghaznavid province, his Indian campaigns were raids rather than conquests, and the kingdoms he attacked, including the Chaulukyas, recovered after he left.

The sources

The main accounts come from Mahmud’s side. The court poet Farrukhi Sistani, who claimed to have accompanied the army, celebrated the raid in verse. He also offered the theory that the name Somnath came from Su-Manat, linking the idol to Manat, a goddess of pre-Islamic Arabia; modern scholars reject this, as Somanatha means “lord of the moon” in Sanskrit.

The historian Gardizi wrote a shorter account around 1050, and Al-Biruni mentioned the event in his study of India. The fullest narrative is by Ibn al-Athir, writing about two centuries later. Over time the story was embellished, with tales of a floating idol held up by magnets and of jewels hidden inside the image.

Sanskrit and Jain sources from Gujarat say surprisingly little. Inscriptions record that the temple was soon back in use, and in about 1169 the Chaulukya king Kumarapala rebuilt it in stone. The historian Romila Thapar has argued that the raid took on its central place in Hindu–Muslim memory mainly in later centuries.

Later memory

In 1842, after the First Anglo-Afghan War, the British governor-general Lord Ellenborough announced that the “gates of Somnath” had been recovered from Mahmud’s tomb at Ghazni and would be returned to India. The gates turned out to be of Afghan deodar wood and of later date, not from Somnath. They were never returned to Gujarat and are kept at Agra Fort.

In the nineteenth and twentieth centuries the raid became a powerful symbol in debates about Indian history and identity. The temple had been attacked again by the army of Alauddin Khalji in 1299 and by later rulers. By the nineteenth century the medieval building stood in ruins, partly converted into a mosque, while worship continued at a nearby temple built in 1783 by the Maratha queen Ahilyabai Holkar. Photographs taken in the 1860s record the ruined structure before it was cleared. After Indian independence, the politician K. M. Munshi led a campaign to rebuild it, and the new temple was inaugurated by President Rajendra Prasad in May 1951.

Myths and facts

  • Myth: The idol floated in the air, held by magnets. Fact: This story appears in later writers and has no basis in the earliest accounts.
  • Myth: The temple lay in ruins from 1026 until 1951. Fact: It was rebuilt within decades and restored or rebuilt several times before its later destructions.
  • Myth: The “gates of Somnath” at Agra came from the temple. Fact: They are later Afghan work.

Timeline

  • 998: Mahmud becomes ruler of Ghazni.
  • c. 1000–1027: Mahmud’s campaigns into India.
  • October 1025: Mahmud leaves Ghazni for Gujarat.
  • January 1026: Somnath is taken and the temple sacked.
  • Spring 1026: Mahmud returns to Ghazni through Sindh.
  • 1030: Death of Mahmud.
  • c. 1169: Kumarapala rebuilds the temple in stone.
  • 1842: Lord Ellenborough’s “Proclamation of the Gates”.
  • 1951: The modern Somnath temple is inaugurated.

Why it matters

The sack of Somnath was one of the most dramatic episodes of the Ghaznavid raids that opened the way for later Muslim states in northern India, such as the Delhi Sultanate. It is also a case study in how historical memory is shaped, as an eleventh-century raid was retold for very different purposes over the following thousand years.

Frequently asked questions

When did Mahmud of Ghazni attack Somnath?

Mahmud left Ghazni in October 1025 and reached Somnath in January 1026, where his army took the temple after a short siege. He returned to Ghazni in the spring of 1026.

Why did Mahmud of Ghazni raid Somnath?

The temple was famous and very wealthy, and its plunder brought Mahmud great riches. Court writers also presented the raid as a victory for Islam over idol worship, which enhanced his prestige in the Muslim world.

How many times did Mahmud invade India?

Tradition credits him with 17 campaigns into India between about 1000 and 1027. Modern historians count them differently, but Somnath was among the last and most famous.

Was the Somnath temple rebuilt after Mahmud?

Yes. It was rebuilt within a few decades and again in stone under the Chaulukya king Kumarapala around 1169. It was damaged in later centuries, and the present temple was consecrated in 1951.

What are the gates of Somnath?

In 1842 the British governor-general Lord Ellenborough had a pair of gates removed from Mahmud's tomb at Ghazni, claiming they had been taken from Somnath. They proved to be later Afghan work and are now kept at Agra Fort.

What sources describe the sack of Somnath?

The main accounts are Persian and Arabic: the court poet Farrukhi, the historian Gardizi, the scholar Al-Biruni, and the later historian Ibn al-Athir. Contemporary Sanskrit sources say surprisingly little about the raid.

Sources and further reading

  • Romila Thapar, Somanatha: The Many Voices of a History (Verso, 2005)
  • Richard H. Davis, Lives of Indian Images (Princeton University Press, 1997)
  • Al-Biruni, Kitab al-Hind (Alberuni's India), trans. Edward C. Sachau (1888)
  • Encyclopaedia Britannica, "Mahmud of Ghazna"

Cite this article

“Mahmud of Ghazni and the Sack of Somnath Temple (1025).” Chronicle, https://chronicle.bigworldlist.com/articles/mahmud-of-ghazni-sack-of-somnath-1025/.