Having negotiated a treaty with Elak the Usbek, the province of Maver-ul-nere was ceded to him, for which he made an ample return in presents of great value; and the closest friendship and familiarity, for a long time, existed between the kings.
Mahmud made a vow to heaven that if ever he should be blessed with tranquillity in his own dominions he would turn his arms against the idolaters of Hindustan. He marched in the year 391 (Ad Hegira) from Ghazni with ten thousand of his chosen horse, and came to Peshawur, where Jipal, the Indian prince of Lahore, with twelve thousand horse and thirty thousand foot, supported by three hundred chain-elephants, opposed him. On Saturday, the 8th of the month Mohirrim, in the year 392 of the Hegira, an obstinate battle ensued, in which the Emperor was victorious; Jipal, with fifteen of his principal officers, was taken prisoner, and five thousand of his troops lay dead upon the field. Mahmud in this action acquired great wealth and fame, for round the neck of Jipal alone were found sixteen strings of jewels, each of which was valued at one hundred and eighty thousand rupees.
After this victory, the Emperor marched from Peshawur, and investing the fort of Batandi, reduced it, releasing his prisoners upon the payment of a large ransom, and the further stipulation of an annual tribute, then returned to Ghazni. It was in those days a custom of the Hindus that whatever rajah was twice defeated by the Moslems should be, by that disgrace, rendered ineligible for further command. Jipal, in compliance with this custom, having raised his son to the government, ordered a funeral pile to be prepared, upon which he sacrificed himself to his gods.
A year later, Mahmud again marched into Sistan, and brought Kaliph, who had mismanaged his government, prisoner to Ghazni. Finding that the tribute from Hindustan had not been paid, in the year A.H. 395 he directed his march toward the city of Battea, and, leaving the boundaries of Multan, arrived at Tahera, which was fortified with an exceeding high wall and a deep, broad ditch. Tahera was at that time governed by a prince called Bakhera, who had, in the pride of power and wealth, greatly troubled the Mahometan governors whom Mahmud had delegated to rule in Hindustan. Bakhera had also refused to pay his proportion of the tribute to Annandpal, the son of Jipal, of whom he held his authority.
When Mahmud entered the territories of Bakhera, that prince called out his troops to receive him, and, taking possession of a strong position, engaged the Mahometan army for the space of three days; in which time they suffered so much that they were on the point of abandoning the attack. But on the fourth day, Mahmud appeared at the head of his troops, and addressed them at length, encouraging them to win glory. He concluded by telling them that this day he had devoted himself to conquest or to death. Bakhera, on his part, invoked the gods at the temple, and prepared, with his former resolution, to repel the enemy. The Mahometans charged with their usual impetuosity, but were repulsed with great slaughter; yet returning with fresh courage and redoubled rage, the attack was continued until the evening, when Mahmud, turning his face to the holy Kaaba, invoked the aid of the Prophet in the presence of his army.
"Advance! advance!" cried then the King. "Our prayers have found favor with God!"
Immediately a great shout arose among the host, and the Moslems, pressing forward as if they courted death, obliged the enemy to give ground, and pursued them in full retreat to the gates of the city.
The Emperor having next morning invested the place, gave orders to make preparations for filling up the ditch, which task in a few days was nearly completed. Bakhera, finding he could not long defend the city, determined to leave only a small garrison for its defence; and accordingly, one night, he marched out with the rest of his troops, and took position in a wood on the banks of the Indus. Mahmud, being informed of his retreat, detached part of his army to pursue him. Bakhera, by this time, was deserted by fortune and consequently by most of his friends; he found himself surrounded by the Mahometans and attempted in vain to force his way through them. When just on the point of being taken prisoner, he turned his sword against his breast, while the most of his adherents were slaughtered in attempting to avenge his death. Mahmud, in the mean time, had taken Tahera by assault; and found there one hundred and twenty elephants, many slaves, and much plunder. He annexed the town and its dependencies to his own dominions, and returned victorious to Ghazni.
In the year A.H. 396 he formed the design of reconquering Multan, which had revolted from his rule. Achmet Lodi, the regent of Multan, had formerly acknowledged the suzerainty of Mahmud, and after him his grandson Daud, till the expedition against Bakhera, when Daud withdrew his allegiance. The King marched in the beginning of the spring, with a great army from Ghazni, and was met by Annandpal, the son of Jipal, Prince of Lahore, in the hills of Peshawur, whom he defeated and obliged to fly into Cashmere. Annandpal had entered into an alliance with Daud; and as there were two passes only by which the Mahometans could enter Multan, Annandpal had taken upon himself to secure that by the way of Peshawur, which Mahmud chanced to take. The Sultan, returning from the pursuit, entered Multan by the way of Betanda, which was his first intention. When Daud received intelligence of the fate of Annandpal, thinking himself too weak to keep the field, he shut himself up in his fortified place and humbly solicited forgiveness for his fault, promising to pay a large tribute and in the future to obey implicitly the Sultan's command. Mahmud received him again as a vassal, and prepared to return to Ghazni, when news was brought to him from Arsallah, who commanded at Herat, that Elak, the King of Kashgar, had invaded his realm with an army. The King hastened to settle the affairs of Hindustan, which he put into the hands of Shokpal, a Hindu prince who had resided with Abu-Ali, governor of Peshawur, and had turned Mussulman, taking the name of Zab Sais.
The particulars of the war of Mahmud with Elak are these: It has already been mentioned that an uncommon friendship had existed between this Elak, the Usbek king of Kashgar, a kingdom in Tartary, and Mahmud. The Emperor himself was married to the daughter of Elak, but some factious men about the two courts, by misrepresentations of the princes to one another, changed their former friendship to enmity. When Mahmud therefore marched into Hindustan, and had left the field of Khorassan almost destitute of troops, Elak took advantage of the opportunity, and resolved to appropriate that province to himself. To accomplish his design he ordered his general-in-chief Sapastagi, with a large force, to enter Khorassan; and Jaffir Taghi at the same time was appointed to command in the territory of Balak. Arsallah, the governor of Herat, being informed of these motions, hastened to Ghazni, that he might secure the capital. In the mean time the chiefs of Khorassan, finding themselves deserted and being in no condition to oppose the enemy, submitted themselves to Sapastagi, the general of Elak.