Before he entrenched himself at Lahore banishing Kusru Malik to Ghazni, Muhammad had quite a few encounters in India. His first engagement was with the Karmatians of Multan in 1175. Some 150 years earlier the Karmatians had been dislodged by the Ghaznavids, but they had regained their possessions after Mahmud’s death. What administrative arrangements Muizzuddin made after ousting the Karmatians from Multan was not known, but they were unable to come back to power thereafter.
In 1176, Muizzuddin attacked Uchch and assigned the conquered territory to Ali Kirmaj. Subsequently, it was given to Nasiruddin Aitam and then to Qubacha. In 1178-79, he proceeded to Nahrwala through Uchch and Multan; he was thinking of following Mahmud and of reaching the south and its temple treasures through Rajasthan and Gujarat. However, at the foot of Mount Abu when his army for the first time faced the army of an Indian ruler, they were probably a tired lot.
The Rai of Mahrwala had a large army and a formidable number of elephants. He defeated Muizzuddin decisively at Kayadra, but Muizzuddin somehow escaped with his defeated army from Gujarat. Learning from his mistakes in Nahrwala, Muizzuddin revised his strategy and annexed Furshor (Peshawar), a long-time Ghaznavid possession in India. After Peshawar, he made Khusru Malik at Lahore a sort of vassal and then in 1182 conquered the area upto the seacoast of Debal, its Sumra ruler accepting his suzerainty. Taking a respite for three years, in 1186 he disposed off Khusru Malik from Lahore.
It would be seen that Muizzuddin had now military encampments from Debal to Sialkot and from Peshawar to Lahore. In this way, he consolidated his power in Punjab and Sindh before attacking the Rajputs. Ali Karmakh, the sipah salar, was in charge of the executive and the military while Maulana Sirajuddin, father of the author of Tabaqat- i-Nasiri, looked after the judicial administration of the area.
Thereafter Muizzuddin captured the fort of Bhatinda or Tabarhinda and gave it to the charge of Ziauddin Tulaki. He advised Tulaki to hold on for eight months, presumably the time taken to and from Ghazni where he intended to go for reinforcements. Meanwhile, Prithviraj Chauhan (who was viewing these developments with concern) decided not to allow any more time for consolidation and proceeded to Tabarhinda to dislodge the Ghurids from their stronghold. Though not ready for a major batde, Muizzuddin turned back to meet Rai Pithora (or Prithviraj) and all the ranas of Hind according to Tabaqat-i-Nasiri. Ferishta stated that the opposition consisted of two hundred thousand horsemen and thirty thousand elephants which historians regard as impossible figures.
The encounter took place at Tarain in 1191 in which Muizzuddin was injured. Describing the circumstances in which the Sultan received his injuries, Minhaj says: “The sultan attacked the elephant on which the ruler of Delhi, Govind Rai, was riding and was moving about in front of his ranks…He struck his lance at the face of the Rai with such a force that two of his teeth fell into his mouth. The Rai threw a javelin at him and severely wounded his arm. The Sultan turned round his charger’s head and retreated. Due to the agony of the wound, he was unable to remain seated on horseback and was about to fall on the ground when a lion-hearted warrior, a Khalji stripling, recognised him, sprang up (on the horse) behind the Sultan and supporting him in his arms, urged the horse with his voice and brought him out of the field of battle” (Tabaqat-i-Nasiri).
After defeating Muizzuddin, Prithviraj besieged the fort at Tabarhind which fell to him after holding out for thirteen months. During this time, Muizzuddin continued with preparations for his second attack on Tarain.