SHAHIS OF PUNJAB & KABUL, Last Native Rulers of Punjab in the Medieval Ages

"The Hindu Shahi dynasty is now extinct, and of the whole house there is no longer the slightest remnant in existen...


A couple of years ago the author became interested to study and explore the history of Punjab before the Turk & Afghan period. There was an inquisitiveness to know about the last native rulers before Sikhs took it in 1765.

There were some references to Jayapala, Hindu Shahi ruler and his successors who ruled Punjab and their battles with the infamous Mahmud of Ghazni who invaded India 17 times in early part of 11th century. After much research I was able to find a few books, and a couple of them require special mention. The Last Two Dynasties of Sahis by Dr. Abdur Rehman is an excellent piece of work as it is based on contemporary Persian and Arabic sources and does not rely on English translations. The Hindu Shahis of Afghanistan and the Punjab AD 865-1026 by Dr. Yogendra Mishra who has studied in-depth the 12th century Sanskrit text Rajatarangini which deals with the history of Kashmir rulers who were neighbours and allies of Hindu Shahis.

Why are they called Hindu Shahi?

The word 'Shahi' is used is an Indianised form of Persian word Shao (Shah means King) and has been used as a title by Non-Muslims rulers of Kabul and Gandhara since the Kushan Kings (3rd century onwards.) The stone inscriptions of these kings and the Rajatarangini have the form Sahi.

Alberuni, the great scholar of medieval ages who accompanied Mahmud Ghanznavi called them Hindu Shahis dynasty to distinguish them from the previous dynasty which he called the Turk Shahi dynasty. This dynasty was lost in history and was rediscovered by British historians in the 1860s when they translated the Persian texts of the sub-continent.


Alberuni's monumental work Tarikh Al-Hind (History of India) and Pandit Kalhana's Rajatarangini written about 100 years after the demise of last ruler are important sources of history. The descendants of Shahis were living in Kashmir at the time. Utbi's account (he was the court historian of Mahmud) is a good source on the battles between Shahis and Mahmud. Other chronicles written by Persian and Arab Muslims have written on the pre-Mahmud Ghaznavi wars with Shahis in some details.


Alberuni calls them 'Brahmins' but Pandit Kalhana calls them Kshatriya. T Mohan has written a whole chapter in his book to prove them as 'Mohyal Brahmins.' CV Vaidya also put them as 'Brahmins' based on Alberuni assertion. Kalhana was a Brahmin himself and would have definitely known and written if they were Brahmins. Dr Mishra and Dr Rehman and a host of other historians believe them to be Kshatriya. JD Cunningham based his work on Elliott's translation and he interpreted and thought that Jaypal and his descendants were Janjua Rajputs. We now know that Elliott's translation has a few flaws in terms of names of people and places.

Dr Rehman believes, based on their presence in their army, that they were Ghakars . To be fair we cannot be certain about their origin. Two previous great dynasties of North India, Guptas and Vardhana (Harsha) were not Kshatriya. It would be safe to say they were Punjabis.


Kallar (c843-50), the founder of the Hindu Shahi dynasty, is known only from Abu Rihan Alberuni's list. The precise circumstances which led to his rise are still a mystery. He was the minister of Kabul Shah (Persian historians called Turk Shahi rulers by this name as Kabul was their capital) who found wealth and dethroned his unpopular king Lagaturman (Turk Shahi) who had suffered defeat at the hands of Arabs/Persians. Apparently this was done without a drop of blood. The word kallar in Panjabi actually means salinity or saline, and is specially used with reference to the saline soil which seriously affects the local agriculture. A lot of places are called Kallar in Punjab and some of it could be due to saline soil but other may refer to the ruler as well. We can conclude salt range was part of his territory.

Main political achievements

The author does not wish to bore the readers with the detailed political history of the Shahis. They were ruling Kabul, Gandhara and western Punjab. The capital Kabul was lost for a few years but regained after 7-8 years which prompted the Shahis to change their capital to Ubandhpura (called Wahind by contemporary Muslim writers) in present Khyber Pakhtunkhwa province in Pakistan. During a rule of Lalliya (880-902) the province of Ghazna was won and ruled by feudatory rulers.

It was only in 977 & 986 CE that they finally lost Ghazni and Kabul. To reclaim the lost territories Jayapala (964-1002) decided to attack Ghazna. An indecisive battle went on for a few days, and then came an unfortunate snow storm which wrecked the calculations of the Shahi. Hardy Turks seem to have better withstood the ravages of the weather than their Indian counterparts, who were more accustomed to the hot climate of the Indian plains. A similar thing happened when General Zorawar Singh invaded Tibet in 1841 and lost due to the heavy snowfall.

A cursory glance on websites hosting the history of Afghanistan do not mention this fact and state that Islam came to the country in mid-7th century and then jump to Mahmud Ghaznavi's father Sabuktigin in the 10th century. In 990 Lahore was won over and following loss of capital in 1002, Nandana was made the new capital.

Last ruler of Punjab

Trilocanpala (1010-21), inherited a truncated kingdom but he made up for some territorial losses by expanding further into the Siwalik Hills and his kingdom extended from the river Indus in the northwest to the upper Ganges valley. After years of war with Mahmud, his father Anandapala (1002-10) agreed to a tributary status in 1008.

In 1012 Mahmud wanted passage to attack Thanesar (in Haryana.) As per the treaty, Shahi allowed the passage, played mediator and asked Mahmud to spare the city and the famous temple in compensation of a big amount of treasure along with tributary status. Even the generals were keen on it, but Mahmud said he was an 'idol breaker' and went ahead and ransacked the city and famous temple of Thanesar. Trilocanapala felt there was no option left but to revoke the peace treaty.

In 1014 Mahmud came to attacked Nandana with an intention to 'solve Shahi problem once for all'. The Shahi opened two fronts. He left Nandana with his son Bhimapala and opened another front in Kashmir with the assistance of Kashmiri general Tunga. The height made it very difficult to Mahumd to win on the Kashmir front however he won the other front and captured Nandana fort. The foolhardiness of Tunga over his initial success led to his defeat at Kashmir front. He left the strategic height and came out in open and was defeated. The Shahis took refuge in the Siwalik Hills.

Last battle in western Uttar Pradesh & Death

Trilocanpala's decision to expand further to Siwalik Hills (region of Himachal and Uttrakhand) led him into wars with Rai of Sharwa.

In 1019, the Shahi came out of Siwalik and joined Chandella ruler in his battle with Mahmud on the banks of river Ram Ganga. Vidyadhara Chandella, despite his superior numbers, left the battle at the first glimpse of defeat and it was left to Shahi to fight till the end. His two wives and two daughters were captured by Mahmud. In 1021 Trilocanpala was killed by some Hindu troops. Historians suggest the hand of Rai of Sharwa in this killing. A similar thing happened 800 years hence, Maharaja Sher Singh, under whom Ladakh was won, was murdered by fellow Sikh generals.

Hindu Shahi - 11th & 12th century

Bhimapala, Trilocanpala's son, continued the battle from Siwalik and he passed away in 1026 AD. The historical sources mention the name of descendants of this Hindu Shahi for another four generations, up to 100 years. The book Adah al-Harb mentions that the grandson of Shah of Kabul (Hindu Shahi) by the name of Sandbal who seem to have ruled in Siwalik Hills led the expedition along with Devpal Hariana and Tab Mai Rai (two small chiefs of Siwalik Hills) attacked Lahore in 1043 AD. The Ghaznavid general defended the city and Sandbal was made a special target by an intrepid Turkish sharpshooter who recklessly dashed through the attackers lines and shot an arrow which pierced through the chest of Sandbal. His army left without a leader and ultimately took to flight.

Shahis in Kashmir

With the decline of their power in the Panjab, some of the Shahi princes migrated to Kashmir and settled there. Kalhana's Rajatarangini does not give us a systematic account of these immigrant Shahis but three generations of them can be clearly identified who enjoyed power and influence.

Three Shahi brothers namely Rudrapala, Diddapala and Anangapala had great influence on the Kashmirian king Ananta (A.D. 1028-63). Rudrapala was married to a daughter of Induchandra (also written as Indrachandra), the ruler of Jalandhar and Kangra. Among the second generation, Bijja was endowed with great courage and persuasive skill, which saved Kalasa, as the crown prince, from the wrath of his father, Ananta. Kalhana mentions the third generation Shahi princess, Vasantalekha, as a wife of the Kashmirian king Harsha (A.D. 1089-1101).

Kalhana does not mention the names of the fourth generation of Shahis who would have been contemporaries of Kalhana. The Shahis, like other prominent families of Kashmir at the time, had to cast their allegiance with crown princes. The Kashmiri king, Jaysimha, became the ruler in 1128 AD after open rebellion against his father. According to Dr Mishra, the Shahis had supported the King, hence Kalhana did not mention the Shahis lest he incur displeasure of Jayasimha.

Among Kalhana's own contemporaries some Kashmirian Kshatriya families still traced their origin to the royal dynasty of the Shahis.


There are some fascinating parallels between the Shahis and the Sikhs who ruled Punjab despite a gap of over 700 years between the two regimes. Dr Hari Ram Gupta in History of Sikhs lamented that Hindus never cared about northwestern frontier and Sikhs, like the Shahis, had to face the brunt of invasions themselves with little assistance from the rest of the country.

According to Dr Rehman, the Shahi state was prosperous and contemporary Muslim chroniclers state that people of Kabul city adored 'Kabul Shah' (literal meaning: King of Kabul). There was a Muslim minority in Kabul (they settled when the Shahis lost for it for eight years) and in Ghazni, but they were not mistreated by the Shahis despite the historical aggression and invasions from Persian/Arabic generals. The Shahis were the last native rulers of Punjab till Sikhs captured the Lahore and Sirhind province in 1765.

Shahis were devotees of Lord Shiva and some of their majestic temples still survive in Pakistan. The photographs are from my friend Shahid Shabbir of the Pakistan Heritage Club who runs the Save Historical Places of Pakistan Facebook page and is spearheading research into Sikh and Hindu heritage sites in Pakistan. I saw these pictures a couple of years ago and they inspired me to read more about them and learn more about our our Punjabi heritage.

The author will end this write up with Alberuni's tribute to the Shahis "The Hindu Shahi dynasty is now extinct, and of the whole house there is no longer the slightest remnant in existence. We must say that, in all their grandeur, they never slackened in the ardent desire of doing that which is good and right, that they were men of noble sentiment and bearing."

Note: The author is a Nottingham based amateur historian with a keen interest to share important but lesser known facts about Sikh & Punjabi history with the new generation.

Photos by Shahid Shabbir

Malot1 (27K) Malot2 (69K)
Malot temple & fort on a hilltop in district Chakwal, West Punjab shows the influence of Kashmri architecture.
Bilot (42K) Bilot1(1) (65K)
Bilot temple near Bilot Sharif, Dera Ismail Khan District, Khyber Pakhtunkhwa displays a conical 'sikhara' top unlike the pyramidal form of the Kashmirian temples.

Amb Sharif (58K) Amb Sharif1 (46K)
Amb Sharif temples in Soon Valley, Khushab District, West Punjab

Nandana (25K) Nandana1 (32K)
Nandana Temple & remains of a fort are situated on a hilltop near Baghanwala some 22 kilometres, East of Pind Dadan Khan in Jhelum district, West Punjab.

Add a Comment