The Ghaznavids and Seljuqs

The Ghaznavid Campaign in Gandhara and Northwestern India

After Mahmud of Ghazni was repulsed in 1008 in his attack on the Qarakhanid Empire to his north, he enlisted the Seljuq Turks in southern Sogdia and Khwarazm to defend his kingdom from Qarakhanid retribution. The Seljuqs were an enslaved Turkic tribe that had been used as defense forces by the Samanids and had converted to Islam in the 990s. Having secured his homeland, Mahmud now turned his attention back to the Indian subcontinent.

Several decades earlier, in 969, the Fatimids (910 – 1171) had conquered Egypt and had made it the center of their rapidly expanding empire. They were seeking to unite the entire Muslim world under their banner of the Ismaili sect in preparation for the coming of the Islamic messiah, an apocoplyptic war, and the end of the world, predicted for the beginning of the twelfth century. Their domain extended from northern Africa to western Iran and, as a major sea power, they sent missionaries and diplomats far afield to extend their influence and faith. They were the major rivals of the Sunni Abbasids for the leadership of the Islamic world.

The vestiges of Muslim rule in Sindh after the Umayyad conquest were extremely weak. Sunni governors paid nominal allegiance to the Abbasid caliph, while in fact sharing power with local Hindu rulers. Islam coexisted peacefully with Buddhism, Hinduism, and Jainism. Ismaili missionaries, however, found a receptive audience among Sunnis and Hindus there dissatisfied with the status quo. By 959, the ruler of Multan, northern Sindh, converted to Ismaili Shia and, in 968, Multan declared itself an Ismaili Fatimid vassal state, independent of the Abbasids. At this point, the Abbasids, joined by their Ghaznavid vassals, were surrounded to the east and west by their Fatimid rivals. They feared an impending two-front invasion. To attack the Ghaznavids, the Ismailis of Multan would merely need to pass through the territory of the Ghaznavid enemies, the Hindu Shahis.

Although his father had favored the Shiite form of Islam, Mahmud of Ghazni had adopted Sunni, the predominant faith of not only the Abbasids, but also of the Qarakhanids and Samanids. He was infamous for being intolerant of other forms of Islam. After ascending to the throne in 998 and consolidating his power in Afghanistan, he attacked the Hindu Shahis in Gandhara and Oddiyana in 1001 and defeated his father’s enemy, Jayapala, whom he also perceived as a potential threat. Although Oddiyana was still a main center of Buddhist tantra, with both King Indrabhuti and Padmasambhava having hailed from there prior to the Hindu Shahi rule, it lacked any flourishing Buddhist monasteries. Its Hindu temples, on the other hand, abounded with wealth. Consequently, Mahmud looted and destroyed them.

Jayapala’s successor, Anandapala (r. 1001 to 1011), now formed an alliance with Multan. But by 1005, Mahmud defeated their joint forces and annexed Multan, thus neutralizing the Fatimid Ismaili threat to the Sunni Abbasid world from the east. Mahmud called his troops “ghazi,” warriors for the faith, and termed his campaign a “jihad” to defend orthodox Sunni observance against the heresy of Ismaili Shia. Although religious zeal might have been part of his motivation, a greater part was undoubtedly his wish to establish himself as the defender of the Abbasids as leaders of the Islamic world. Playing such a role would legitimize his own rule as an Abbasid vassal and the loot that he plundered would help finance anti-Fatimid campaigns of the Abbasids elsewhere. For example, the ancient Hindu sun temple, Suraj Mandir, in Multan, was reputedly the wealthiest temple of the Indian subcontinent. Its treasures only increased Mahmud’s thirst for more riches, further to the east.

After Mahmud’s unsuccessful campaign against the Qarakhanids, he returned to the Indian subcontinent and, in 1008, defeated an alliance between Anandapala and the Rajput rulers in present-day Indian Punjab and Himachal Pradesh. He confiscated the enormous Hindu Shahi treasury in Nagarkot (present-day Kangra), and, over the next years, plundered and destroyed the wealthy Hindu temples and Buddhist monasteries in the area. Among the Buddhist monasteries that he destroyed were those in Mathura, south of present-day Delhi.

In 1010, Mahmud quashed a rebellion in Multan and, in either 1015 or 1021 (depending on which source one accepts), he pursued the next Hindu Shahi ruler, Trilochanapala (r. 1011 – 1021), who was consolidating his forces at Lohara fort in the western foothills leading to Kashmir. Mahmud, however, was never able to take the fort, or to invade Kashmir. It is unclear how strong a role the Hindu founder of the First Lohara Dynasty of Kashmir (1003 – 1101), Samgrama Raja (r. 1003 – 1028), played in Mahmud’s defeat. According to traditional Buddhist accounts, the Ghaznavid ruler was stopped by Buddhist mantras recited by Prajnarakshita, a disciple of Naropa.

Due to the heavy damage that Mahmud’s forces inflicted on the Buddhist monasteries in Indian Punjab and Himachal Pradesh, many Buddhist refugees sought asylum elsewhere. But, with the Ghaznavid troops attacking in the direction of Kashmir, most refugees did not feel secure in fleeing there. Such a large number flooded instead across the Himalayas via Kangra to Ngari in western Tibet that in the 1020s its king passed a law restricting foreigners from staying in the country more than three years.

In summary, the Ghaznavid jihad in the Indian subcontinent was originally directed against the Ismailis, not the Buddhists, Hindus, or Jains. However, once Mahmud had accomplished his religious and political goal, his victory incited him to gain further territory and especially loot from the wealthy Hindu temples and Buddhist monasteries in them. As with the Umayyad campaign three centuries earlier, the Turkic forces destroyed temples and monasteries, after thoroughly looting them, as part of their initial conquest of areas, but did not seek to impose Islam on all their new subjects. Mahmud was pragmatic and utilized unconverted Hindu troops and even a Hindu general against Shiite Muslims who resisted him in Buyid Iran. His main target remained the Shiites and Ismailis.

Top