For four centuries between the death of Harṣa (647 CE) and the consolidation of Ghaznavid power in the Punjab (c. 1030 CE), Bhārata's north-western gate was held by a succession of Hindū kings whose names are now footnotes in their own land. They are not footnotes in the chronicles of those who killed them.

Al-Utbī, secretary to Maḥmūd of Ghazna, wrote of Jayapāla and Ānandapāla with the exasperation of a courtier whose master could not finish what he had begun. Al-Bīrūnī, who arrived in India in the baggage train of conquest and stayed to become its first serious foreign scholar, paid the Śāhi house the tribute that history pays only to the genuinely formidable: he called them noble, and meant it.

This essay reconstructs what stood on that frontier, what fell, and at what cost — drawing on the Muslim chronicles themselves, on the Rājataraṅgiṇī of Kalhaṇa, on epigraphic evidence from Hund and Dewal, and on the testimony of Al-Bīrūnī's Taḥqīq mā li'l-Hind. It is the most consequential resistance in Indian history that almost no Indian remembers.

Manusmṛti 8.15
धर्मो रक्षति रक्षितः
dharmo rakṣati rakṣitaḥ
Dharma, protected, protects.

The Three Hundred Years That Were Not Empty

The standard Western and post-colonial Indian narrative compresses Indo-Islamic history into two events separated by a void: Muḥammad bin Qāsim's conquest of Sindh in 712 CE, and Maḥmūd of Ghaznī's raids beginning in 1001 CE. The intervening three centuries are presented as a lull, an interval, perhaps a failure of Islamic ambition.

The lull is real. The reason for it is what has been suppressed.

After Qāsim's reduction of the Brahman king Dāhir at Aror in 712 CE, the Arab armies of the Umayyad and early ʿAbbāsid Caliphates attempted, repeatedly, to push beyond Sindh into the Indian heartland. Every such attempt was broken. Bappā Rāwal of Mewār, the Gurjara-Pratīhāra emperor Nāgabhaṭa I, and the Cāḷukya Vikramāditya II turned back successive invasions through what later Arab geographers called the Battle of Rajasthan (c. 738 CE) — a campaign so devastating that Sulaimān al-Tājir, writing in the ninth century, recorded that "there is no king in India that is not subject to the Balhārā" — by which he meant the Rāṣṭrakūṭa emperor — and noted that the kingdom of Jurz (the Gurjara-Pratīhāras) was "the chief enemy of Islām."

This is not interpretation. It is what the invaders said themselves.

The frontier of Islam was held east of the Indus by a wall of Hindū polities — the Pratīhāras at Kanauj, the Cāhamānas, the Karkoṭa and Utpala kings of Kaśmīr, the early Cālukyas — and crucially, by the dynasty that physically occupied the Khyber and the Kabul valley: the Turk-Śāhis and after them the Hindū-Śāhis. For three centuries after Sindh, the gates of Bhārata held. The Caliphate, which conquered from the Atlantic to the Oxus in less than a hundred years, was stalled at the Indus for nearly three hundred and twenty.

That is the achievement of the kingdoms that were standing when Sabuktigīn came. Of these, none stood closer to the storm than the Hindū-Śāhis of Kābul-Udabhāṇḍapura.

The Geography of the Gate

गिरिः सिन्धुर्नदी द्वारं रक्षति भारतम्
giriḥ sindhur-nadī dvāraṃ rakṣati bhāratam
The mountain, the Sindhu, and the gate — these guard Bhārata.

The Indian subcontinent is a fortress whose ramparts are mountains and whose moat is the sea. The Himālayas seal the north for two thousand miles; the Arakan Yoma seal the east; the Indian Ocean girds the south. There is one true breach in this perimeter, and it lies in the north-west: the corridor from the Iranian plateau through the Hindū Kush mountains, descending by way of the Khyber, Bolan, Tochi, Gomal and lesser passes onto the plains of the Pañjāb and the upper Indus. Every land army that has entered India — Aryan, Persian, Macedonian, Śaka, Kuṣāṇa, Hūṇa, Arab, Turk, Mughal, Durrānī — has come through this gate.

The Hindū-Śāhis held the gate.

Their kingdom, at its zenith under Jayapāla (c. 964–1001 CE), extended from Laghmān west of the Khyber, through Kābul, across the entire Gandhāra region (the Peshawar valley), up the Indus to Udabhāṇḍapura (modern Hund, near Attock), south to Multān (held tributary), and east through the entire Pañjāb up to the Sutlej — touching the territories of the Tomara kings of Delhi and the Cāhamānas of Śākambharī. It included the strategic salt-range fortress of Nandana, the rich agricultural plains of the sapta-sindhu, and the trade emporium of Lahāwar (Lahore). North, the Karakoram and the Pamirs sealed it; west, it faced first the Sāmānid dominions and then, after 977 CE, the Turkic slave-soldiers of Ghaznī.

This was not a small kingdom. By every reckoning of medieval geography, the Hindū-Śāhi realm was the equal of any in northern India. Al-Bīrūnī, writing within a generation of its fall, lists its capitals and notes that its rulers belonged to two successive houses — first the Turk-Śāhis (a Buddhist dynasty, possibly of Hephthalite origin), and then, from approximately 870 CE, the Hindū-Śāhis founded by the Brahman minister Kallar, who deposed the last Turk-Śāhi Lagatūrmān when the latter had become weak and unjust. The early Hindū-Śāhi kings — Kallar, Sāmanta, Bhīma, Jayapāla — were patrons of Śaivism, of Sanskrit learning, and of the temple complexes whose ruins still stand at Khair Khāneh, Tapa Sardār, and along the Indus at Hund.

To understand what was lost when this kingdom fell is to understand that Buddhist Gandhāra, the homeland of the Mahāvibhāṣā and of the Greco-Buddhist sculptural tradition, and Hindū Kābul, where Śiva was worshipped as Zhūn and where the Sun temple of Multān was a pan-Indian pilgrimage site, were not peripheral provinces. They were core territories of Āryāvarta whose loss was not the loss of a frontier but the amputation of a limb.

The Coming of Sabuktigīn

paraphrasing Manu 8.15
यो धर्मं हन्ति स हन्यते धर्मेण
yo dharmaṃ hanti sa hanyate dharmeṇa
He who slays Dharma is slain by Dharma.

The Ghaznavid dynasty arose from a peculiarity of medieval Islamic governance: the institution of the ghulām, the Turkic military slave. Sabuktigīn, born in the steppes around 942 CE, was sold as a boy into the household of the Sāmānid general Alptigīn, who himself had seized the citadel of Ghaznī in 962 CE. On Alptigīn's death and the brief reigns of his successors, Sabuktigīn took Ghaznī in 977 CE — not as a sovereign initially, but as a muqṭaʿ nominally subordinate to the Sāmānids of Bukhārā. Within a decade he was independent in all but name, and his armies were probing south-east into the territory of the Hindū-Śāhi king Jayapāla.

The first contact came over Laghmān, a fertile valley west of the Khyber that had long been part of the Śāhi realm. Around 986 CE, in a stroke that reveals the strategic clarity of the Śāhi court, Jayapāla did not wait to be invaded. He raised an army and marched on Ghaznī itself.

Al-Utbī, hostile witness, records the magnitude:

Jaipāl, having collected an army of one hundred thousand horse and foot, marched towards Ghaznīn, with the intention of utterly destroying that city.

— Taʾrīkh-i Yamīnī

The two armies met in the high country between Ghaznī and Laghmān, in what the Persian chronicles call the field of Ghuzak. The accounts converge on a single dramatic event: as the armies faced each other, a violent storm — snow, rain, and wind, of a severity unusual even for that elevation — descended on both camps. The Śāhi army, equipped for warm-weather campaigning, suffered catastrophic losses in livestock and morale. Jayapāla sued for peace. The terms, as recorded by Ferishta (drawing on Utbī and on earlier sources now lost), required him to cede the territory between Laghmān and the Khyber, surrender fifty elephants, and pay a heavy indemnity.

Here begins the first documented instance of what the chronicles, written by the Ghaznavids themselves, frame as treachery from the Muslim side. Sabuktigīn dispatched envoys to accompany Jayapāla home and collect the tribute. Jayapāla, on reaching his own territory, detained the envoys and refused the indemnity — citing, according to Indian tradition, the principle that an oath extracted under the duress of natural calamity (in this case, the storm) was not binding in dharmic law.

The question of who broke faith here is not a minor curiosity. It is the first instance of a pattern that will recur until the end of the dynasty: the systematic incompatibility between two conceptions of war.

The Dharma of Battle and the Doctrine of Jihād

Manusmṛti 7.91–93
युद्धे चापि न हन्तव्यो भग्नः पतितः आर्तितः
yuddhe cāpi na hantavyo bhagnaḥ patitaḥ ārtitaḥ
Even in battle, the broken, the fallen, the wounded — these shall not be slain.

Before proceeding to the catastrophe of 988 and 1001 CE, the reader must be acquainted with the two codes of war that collided on this frontier. The contrast is not polemical. It is textual.

The Hindū law of war — dharma-yuddha — is codified across the Manusmṛti (Book 7), the Mahābhārata's Śānti-parvan and Bhīṣma-parvan, the Arthaśāstra of Kauṭilya (Book 13), the Agni Purāṇa, and the Śukra-nīti. Its principles, which Indian armies of the Śāhi period treated as binding ritual law, include:

The doctrine of jihād as it operated under the early Ghaznavids drew on a different and well-developed Islamic legal corpus: the Qurʾān (especially Sūra 9, al-Tawbah, and Sūra 8, al-Anfāl), the canonical Ḥadīth collections compiled by Bukhārī, Muslim, Abū Dāwūd, and Tirmidhī in the ninth century, and the early jurisprudence of Abū Yūsuf (Kitāb al-Kharāj) and al-Shaybānī (Siyar). Under this corpus, war against mushrikūn — those associated as partners with God, a category in which Hindūs were placed by the Ghaznavid jurists and explicitly so by Maḥmūd's official panegyrist Farrukhī Sīstānī — admitted:

These are not invented charges. They are the operative jurisprudence under which Maḥmūd's invasions were prosecuted, and they are referenced approvingly by Maḥmūd's own court chroniclers — al-Utbī in the Taʾrīkh-i Yamīnī, Gardīzī in the Zayn al-Akhbār, and Farrukhī in his dīwān of panegyric.

The Hindū armies that faced the Ghaznavids did not understand, at first, that they were not fighting another army. They were fighting a different conception of what an army was for.

988 CE — The First Confederacy

When Sabuktigīn returned to extract by force what had been promised and withheld, Jayapāla did what his geography and his dharma required. He summoned his peers.

Al-Utbī records what he calls, with evident astonishment, the size of the response:

Jaipāl, having sent messages to the Rāyas of Hind, calling them to aid him in the war against the Musulmāns... a host of more than one hundred thousand horse and an innumerable multitude of foot assembled.

— al-Utbī, Taʾrīkh-i Yamīnī

The historical confederacy of 988 CE — the first attested pan-Indian Hindū military coalition against an external invader — included, according to the surviving chronicles, the rulers of Delhi (the Tomaras), Ajmer (the Cāhamānas), Kālañjara (the Candellas), and Kanauj (the late Gurjara-Pratīhāras), with contingents reported also from Kāśmīr and from the Cālukya kingdoms of the south. The army gathered at the western Pañjāb, crossed the Indus, and met Sabuktigīn's forces near Laghmān, in the same high country where Jayapāla had been defeated by the storm two years earlier.

There was no storm this time. There was something worse: a difference in military doctrine that the Hindū commanders had not yet learned to counter.

Sabuktigīn's army was small — perhaps fifteen thousand horse — but it was the prototype of the formation that would dominate Eurasian warfare for the next five centuries: Turkic mounted archers operating in coordinated squadrons of two hundred to five hundred, using the lamellar-armoured horse-archer of the steppe, the composite recurved bow capable of penetrating mail at one hundred paces, and the tactic of feigned retreat to draw enemy cavalry into prepared ambush by reserve squadrons held in dead ground. This was the system perfected by the Türk Qaghanate and inherited by the Sāmānid ghulām corps. The Hindū armies — built around the catur-aṅga-bala, the classical four-fold force of elephant, chariot (largely vestigial by the tenth century), heavy cavalry, and massed infantry — had not yet faced it in concentration.

The chronicles agree on the result. The Hindū line, fighting in good order, was drawn forward by the apparent rout of Sabuktigīn's centre, was struck on both wings by the held reserve, and was broken. The infantry, unable to extricate themselves from elephants now panicking under arrow-fire, took the worst of the pursuit. Jayapāla survived. The territory west of the Indus — Laghmān, Kābul itself, the Khyber — passed permanently to Ghaznī.

This is the moment at which the gate of Bhārata, in the strict topographical sense, fell. Everything that follows is the long retreat of the Śāhis across the Indus into the Pañjāb, fighting from one fortified line to the next.

1001 CE — The Battle of Peshāwar

Bhagavad-Gītā 2.37
हतो वा प्राप्स्यसि स्वर्गं जित्वा वा भोक्ष्यसे महीम्
hato vā prāpsyasi svargaṃ jitvā vā bhokṣyase mahīm
Slain, you attain heaven; victorious, you enjoy the earth.

Sabuktigīn died in 997 CE. After a brief succession struggle his son Maḥmūd seized the throne in 998 CE, secured investiture from the ʿAbbāsid Caliph al-Qādir in Baghdad (the formal title Yamīn al-Dawla, "right hand of the state"), and made a public vow to invade India every year of his reign. The vow was substantially kept: between 1001 and 1027 CE, Maḥmūd conducted seventeen separate campaigns into the subcontinent.

The first was directed at Jayapāla.

In November 1001 CE, Maḥmūd crossed the Khyber with fifteen thousand cavalry and met Jayapāla near Peshāwar, on the plain east of the Bara river. Jayapāla — now an old man, who had ruled for nearly forty years — fielded twelve thousand horse, thirty thousand foot, and three hundred elephants, according to al-Utbī's figures (which may be inflated). The Śāhi army was destroyed in a single day's engagement. Fifteen thousand of Jayapāla's soldiers were killed. Jayapāla himself, with fifteen of his close kinsmen and chief officers, was taken prisoner alive.

What followed was without parallel in the Indian dynastic tradition. Jayapāla was paraded through the streets of Ghaznī as a captive, ransomed by his own son Ānandapāla at the price of fifty elephants and a heavy indemnity, and returned to his territory at Hund. There, in accordance with the Kṣatriya code — yo rājā parābhūto na pratīkartum śaknoti, sa mṛtyum vṛṇuyāt, "the king who has been overthrown and cannot make amends should choose death" — he ascended a funeral pyre that he had ordered built, and immolated himself.

Al-Utbī, the enemy chronicler, records the event in a passage whose grudging respect cannot be missed:

Jaipāl... burnt himself, according to the customs of his ancestors, with his own hands, as a sacrifice. So perished a great prince, whose magnanimity, courage, and resolution had been the wonder of the Hindūs and the dread of the Musulmāns.

— al-Utbī, Taʾrīkh-i Yamīnī

The throne passed to his son Ānandapāla.

1008 CE — The Battle of Cach (Waihind)

Bṛhadāraṇyaka Upaniṣad 1.3.28
असतो मा सद्गमय। तमसो मा ज्योतिर्गमय।
asato mā sadgamaya | tamaso mā jyotirgamaya
From the unreal lead me to the real; from darkness lead me to light.

Ānandapāla, who reigned from 1001 to approximately 1010 CE, is the figure in this drama who most deserves remembrance, and is least remembered. He inherited a kingdom truncated to the eastern Pañjāb, a treasury depleted by his father's ransom, and an enemy who had taken Jayapāla's vow of annual invasion and made it Maḥmūd's. He responded by doing what his father had done in 988: he summoned the second pan-Indian confederacy.

The roll of the kings who answered Ānandapāla's call in 1008 CE is preserved in Ferishta (drawing on contemporary sources) and is one of the most remarkable lists in medieval Indian history:

...the Rāyas of Ujjain, Gwāliyār, Kālañjar, Kanauj, Delhi, and Ajmer entered into a confederacy, and collecting their forces advanced towards the Pañjāb.

— Ferishta

Ferishta then records, in a passage often quoted but rarely properly placed:

The Hindū women, on this occasion, sold their jewels and sent the proceeds from distant parts to their husbands, to enable them to take the field; while those in poor circumstances earned money by spinning cotton, and supplied it for the same purpose.

Note

This is the only such record I know of in medieval Indian dynastic history of a popular war effort that crossed class lines and engaged the women of the polity directly. It is not legend — Ferishta is drawing on sources contemporary or near-contemporary with Maḥmūd's court. It tells us something that the dynastic chronicles by themselves do not: that the Hindū population of north India in 1008 CE understood what was at stake, and acted on it.

The armies met at Cach (also called Waihind in the Muslim sources — the plain between the Indus and the Jhelum, near Hund). The Indian force may have numbered close to thirty thousand cavalry and a much larger infantry; the Ghaznavid force perhaps twenty thousand. Maḥmūd, recognising the gravity of the engagement, fortified his camp with iron-tipped wooden stakes and held his position for forty days before risking battle — the longest defensive posture of his career.

When the battle was joined, it began in Hindū favour. The first charge was delivered by thirty thousand Khokhar tribesmen — a martial people of the western Pañjāb, fighting on foot with sword and shield, who broke through the Ghaznavid centre with such fury that, in al-Utbī's words, "three thousand Musulmāns were slain in a few minutes." The Ghaznavid line wavered. The day, on every account, was Ānandapāla's.

It was lost by an accident that no doctrine could have prevented. Ānandapāla's elephant, struck by a naphtha arrow or panicked by the noise — the chronicles differ — bolted from the field. To the Hindū infantry, watching their king's standard disappear toward the rear, this could mean only one thing. The line broke. Maḥmūd's cavalry, which had been on the verge of retreat, pursued. The slaughter on the road back across the Indus was the worst the Pañjāb had yet seen. Eight thousand Hindūs are recorded as having died in the rout alone, and twenty elephants and immense booty were taken.

This was the last grand confederacy. After Cach, the Hindū kings of the plain did not assemble again as a single field army against Ghaznī. They could not. The strategic depth on which such an assembly depended — the line of the Indus, the fortresses of the Pañjāb, the Śāhi cavalry of Hund — was gone or going.

The End of the Dynasty: Trilocanapāla and Bhīmapāla

Ānandapāla, broken by Cach and by the death of his ally the king of Lahore, retired eastward. He died around 1010 CE and was succeeded by his son Trilocanapāla, who fought Maḥmūd for fifteen more years from progressively more easterly positions — first from Nandana in the Salt Range (taken by Maḥmūd in 1014), then from the foothills of the Śiwāliks, then from refuge with the kings of Kāśmīr.

Kalhaṇa, in the Rājataraṅgiṇī (Book VII), records Trilocanapāla's last battles with unusual emotion for that normally dry chronicler:

He, when he saw the kingdom of his ancestors falling, did not flee; he fought, was wounded, fought again, and was at last betrayed.

— Kalhaṇa, Rājataraṅgiṇī VII.47–69

Trilocanapāla was assassinated by his own mutinous troops around 1021–22 CE. His son Bhīmapāla — called nirbhayā, "the fearless" — held a last fortress in the eastern hills for four more years, and was killed in 1026 CE. With his death the Hindū-Śāhi dynasty, which had held the Indian frontier for approximately one hundred and fifty-five years, was extinguished.

Al-Bīrūnī, present at Ghazna throughout these years and writing within a decade of Bhīmapāla's death, composed the only epitaph the Hindū-Śāhis would receive. It is worth quoting in full, because nothing later said about them by their conquerors equals it:

The Hindū-Śāhīya 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 noble bearing. I admire the following passage of a letter of Ānandapāla, which he wrote to Prince Maḥmūd:

'I have learned that the Turks have rebelled against you and are spreading in Khorāsān. If you wish, I shall come to you with five thousand horsemen, ten thousand foot, and a hundred elephants, or, if you wish, send my son with double the number. In acting thus I do not speculate on the impression this would make on you. I have been conquered by you, and therefore I do not wish that another man should conquer you.'

— Al-Bīrūnī, Taḥqīq mā li'l-Hind

This is the prince of Cach. This is the son of Jayapāla. This is the king whose treasury had been emptied by his father's ransom, whose confederacy had been broken by a frightened elephant, whose ally Maḥmūd was the man who had paraded his father in chains through Ghazna — and who, when he heard that Maḥmūd was in difficulty against the Qarakhānid Turks, offered his army in support of him. The offer was sincere; it was declined; it was remembered.

Al-Bīrūnī's judgement, delivered as a Muslim scholar writing for a Muslim audience and with no Indian to flatter, is the measure of what was destroyed.

The Pattern of War: Deceit, Treaty, and Iconoclasm

A reader unfamiliar with the period might ask: was the Ghaznavid war effort genuinely characterised by treachery, or is this an artefact of pious legend?

The evidence, drawn entirely from Ghaznavid and post-Ghaznavid Muslim sources, is unambiguous on three points.

First, the systematic violation of treaties. Maḥmūd, in 1010 CE, accepted the surrender of the Ismāʿīlī ruler of Multān, Dāwūd ibn Naṣr, on terms that guaranteed his life and the security of his subjects. Within months he returned, deposed Dāwūd, executed the Ismāʿīlī community by the thousands in the streets of Multān (the figures in Gardīzī and al-Utbī range from five thousand to fifty thousand), and confiscated the property of the city. The pretext was that the Ismāʿīlīs, though Muslims, were heretics. The dharmic principle that an oath once given is sacred regardless of the recipient's faith was absent.

Second, the doctrine of feigned retreat and surprise attack. Maḥmūd's victory at the Battle of the Indus (1014 CE) against Trilocanapāla was secured by a feigned withdrawal that drew the Śāhi cavalry across the river in pursuit; the Ghaznavid main body, held in reserve in dead ground, then struck the Hindū force from the flank as it was extended on the riverbank. The same tactic was used against the king of Kanauj in 1018 and against the Cāhamāna at Sirsāwa. Al-Utbī describes these manoeuvres with professional admiration. They were not aberrations; they were doctrine.

Third, the deliberate desecration of temples not as collateral damage but as theological objective. Farrukhī Sīstānī, Maḥmūd's court poet, composed an ode after the sack of Somnāth in 1025–26 CE which celebrates the destruction of the liṅga in terms that leave no doubt as to its religious significance:

The Sōmnāt came forth to complain before the Sulṭān — 'O Maḥmūd! With one blow of the sword thou hast broken the Lāt, the Manāt, and the ʿUzzā!'

— Farrukhī Sīstānī, Dīwān, qaṣīda 88

The reference is to the three pre-Islamic Arabian goddesses whose idols the Prophet had destroyed at the conquest of Mecca. Maḥmūd's poet is explicit: the sack of Somnāth is not war booty, it is a re-enactment of Muḥammad's iconoclasm. The two hundred kilograms of gold taken from Somnāth (Ferishta's figure), and the twenty thousand pilgrims slaughtered in the precincts (al-Qazwīnī's figure), are theological by-products of a theological act.

Against this, the Indian armies — bound by the Manusmṛti's prohibition on attacking the sleeping, the fleeing, the unarmed; bound by the requirement to declare war by herald; bound by the proscription on destroying enemy temples (which, indeed, no Indian dynastic war ever did even between Hindū kingdoms, including the bitter wars between Cāḷukyas, Cōḷas, and Pāṇḍyas) — fought consistently within a code their enemies did not share and did not acknowledge.

This is not to say the Indian armies were militarily innocent. They were not. The Arthaśāstra admits a category of kūṭa-yuddha, deceptive war, against an asura enemy who has himself broken dharma; the Mahābhārata records that the Pāṇḍavas used such tactics against Bhīṣma, Droṇa, and Karṇa. But these are explicitly framed as exceptions to a default norm, and they are remembered with shame even by the victors. In the Ghaznavid corpus, by contrast, deceit in war is not the exception. It is the doctrine.

The cost of fighting an enemy whose rules of engagement permit what yours forbid is borne by the side that holds the older rules.

This is the fundamental asymmetry that made the Hindū defence of the north-west, despite its scale and its courage, ultimately untenable in field battle. It would not be resolved until Hindū armies, under Vijayanagara, under Śivājī, under the Sikh khālsā, learned — slowly, painfully — to develop doctrines of asymmetric and unconventional war that did not surrender their dharmic identity but did not concede the field to the asuric either.

The Three-Hundred-Year Lull, Reconsidered

The reader who has followed this account to this point will understand that the so-called "three-hundred-year gap" between Muḥammad bin Qāsim and Maḥmūd of Ghazna was not empty. It was the period of the most successful and most sustained military defence in Indian history.

That defence was conducted along three concentric rings.

The outer ring was the Hindū-Śāhi kingdom of Kābul-Udabhāṇḍapura — the only Indian polity to hold territory west of the Indus, the gate-keepers of the Khyber, who absorbed the first and heaviest blows for one hundred and fifty-five years (c. 870–1026 CE) and bought Bhārata the time to organise its inner rings.

The middle ring was the Gurjara-Pratīhāra empire of Kanauj — at its zenith under Mihira-Bhoja (r. 836–885 CE) and Mahendrapāla I (r. 885–910 CE), the dominant power of north India for two centuries, whose imperial cavalry was the explicit reason given by the Arab geographer al-Masʿūdī (writing c. 943 CE) for the failure of every Caliphate attempt to advance beyond Sindh. Al-Masʿūdī states it plainly:

The king of Jurz has cavalry such as no other king has, and he is the chief enemy of the Muslims.

— al-Masʿūdī, Murūj al-Dhahab

The inner ring was the network of Rajpūta, Cāhamāna, Candella, and Paramāra kingdoms that emerged from the Pratīhāra collapse and that, even after the fall of the Śāhis, would hold the Indian heartland against direct Islamic political conquest for another one hundred and seventy years — from 1026 to 1192 CE — until the second Battle of Tarain.

A note on Tarain

It is this last point that must be made precisely, because it is constantly confused. The first Battle of Tarain in 1191 CE, in which Pṛthvīrāja Cāhamāna III of Ajmer defeated and very nearly killed Muḥammad of Ghor, sending the Ghorid army in rout back to Ghaznī, was the culmination — not the beginning — of the Hindū resistance described in this essay. It belongs to a later chapter, separated from Maḥmūd's death (1030 CE) by one hundred and sixty-one years. The Indian resistance that "kept the Muslims out" for the three centuries after Bin Qāsim was not won at Tarain — Tarain came afterward. It was won at the unmarked battlefields of Rajasthan (738), at Ghuzak (986), at Laghmān (988), at Peshāwar (1001), at Cach-Waihind (1008), at Nandana (1014), and along the Indus and the Salt Range and the Śiwāliks until 1026 CE.

The Hindū-Śāhis were the men who fought there. They did not win in the end. But they made the end take three hundred years to arrive.

The Map of What Was Held, and What Was Lost

It is useful, finally, to fix in the reader's mind the boundary of Bhārata as the Hindū-Śāhis understood it — for this is the boundary that was conceded, and not yet wholly regained, in the centuries that followed.

In the year 1000 CE, Āryāvarta — the land of dharma in the strict Smārta-Paurāṇic sense — comprised the following:

Of this vast civilisational territory, only the outermost segment — the trans-Indus west and parts of the central Pañjāb — was lost in 1026 CE. The rest stood. It is on the standing remainder that the Indian resistance of the eleventh and twelfth centuries, culminating at the first Tarain in 1191 CE, was conducted.

What was lost was not negligible. Gandhāra, the homeland of Pāṇini, of the Mahāvibhāṣā, of the Greco-Buddhist sculptural tradition; Kābul, the seat of Zhūn-Śiva worship for a millennium; the trans-Indus segment of Uttarāpatha, the great northern road of Buddhist and Hindū learning — these passed beyond the political horizon of dharma and would not return. But the civilisational core held. And it held in significant part because the Hindū-Śāhis stood at the gate for one hundred and fifty-five years and absorbed the blow that would otherwise have fallen on Sthāneśvara, on Kanauj, on Mathurā, in 988 CE rather than in 1018 CE — and on Kāśī, on Prayāga, on Magadha, perhaps in 1010 CE rather than 1193 CE.

The two hundred years they bought were the years in which Indian civilisation completed the Naṭarāja bronzes of the Cōḷas, the temple complexes of Khajurāho and Bhubaneśvara, the philosophical synthesis of Abhinavagupta in Kāśmīr, the Āgamic canonisation of Śaiva-Siddhānta, the great Sthala-purāṇas, and the foundation of the Vīraśaiva and Śrī Vaiṣṇava movements in the south. None of these would have happened in the form they took had Maḥmūd of Ghazna stood at the walls of Vārāṇasī in 990 CE.

This is what the Hindū-Śāhis bought, and at what price.

Epilogue: What Remains

Bhagavad-Gītā 3.5
न हि कश्चित् क्षणमपि जातु तिष्ठत्यकर्मकृत्
na hi kaścit kṣaṇam api jātu tiṣṭhaty akarma-kṛt
No one, even for a moment, can remain without action.

The Hindū-Śāhi dynasty left no enduring chronicle of its own. Its temples are ruins or mosques. Its capital at Hund is a village beside the Indus where farmers occasionally turn up coins struck with the legend Śrī Samanta-deva — the founding king of the dynasty, whose name is preserved on those coins more reliably than in any text. Its language was Sanskrit and a Prākrit ancestor of Pashto. Its religion was Śaiva with strong Sūrya and Gaṇeśa cults. Its art, where it survives, is the late phase of Gandhāran Buddhist-Hindū synthesis. The last reliable account of its history is by the Muslim scholar who arrived with its destroyer, and who alone seems to have understood what he was looking at.

In Bhārata, the memory of the Hindū-Śāhis was preserved only in fragments. Kalhaṇa, writing in twelfth-century Kāśmīr, knew their genealogy. The local oral traditions of the Pothohār plateau and the Salt Range, recorded in colonial gazetteers, still in the nineteenth century identified certain mound-sites as Rāja Jaipāl kā qila. The Janjūā Rajpūts of the upper Pañjāb claim descent from them. A few Sanskrit inscriptions — the Hund slab inscription of Jayapāla, the Dewal inscription of Lallīya — survive in fragments.

But of any continuous Indian historical consciousness of what stood and what fell on the Indus between 870 and 1026 CE, there is almost nothing.

This essay is one effort to begin to repair that absence.

The men who held the western gate of Bhārata for one hundred and fifty-five years — Kallar, Sāmanta, Bhīma, Jayapāla, Ānandapāla, Trilocanapāla, Bhīmapāla — were among the last fully autonomous Hindū sovereigns to rule a territory that included Kābul and Gandhāra. After them, no Indian polity ruled west of the Indus for nine hundred years. The line they held is the line at which dharma and jihād, two of the most consequential civilisational doctrines ever to meet on the field, fought their first sustained engagement.

Dharma did not win that engagement. It also did not lose it. It survived it. The survival, conducted at the cost of one hundred and fifty-five years of unbroken war by one dynasty alone, is what made everything afterward — including Tarain, including Vijayanagara, including Śivājī, including the recovery of an independent Bhārata in the twentieth century — possible.

That is what is owed to Jayapāla, who marched on Ghaznī when he could still march; to Ānandapāla, who summoned the women of the Pañjāb to spin cotton for the army of his confederacy; to Trilocanapāla, who fought wounded and was betrayed; and to Bhīmapāla Nirbhaya, who held the last fortress to the last day.

Smṛti is not merely memory. It is the deliberate refusal to forget what dharma costs, and what it has cost before.

Works Cited

Primary sources (Indic):

Primary sources (Islamic):

Modern scholarship:

— for Dhārā, Smṛti section.