Mu'izz al-Din Muhammad ibn Sam (Persian: معز الدین محمد بن سام, romanized: Muʿizz al-Dīn Muḥammad ibn Sām; c. 1144 – 15 March 1206), also known as Muhammad of Ghor or Muhammad Ghori, was a ruler from the Ghurid dynasty based in the Ghor region of what is today central Afghanistan who ruled from 1173 to 1206. Muhammad and his elder brother Ghiyath al-Din Muhammad ruled in a dyarchy until the latter's death in 1203. Ghiyath al-Din, the senior partner, governed the western Ghurid regions from his capital at Firozkoh whereas Muhammad extended Ghurid rule eastwards, laying the foundation of Islamic rule in South Asia, which lasted after him for nearly half a millennium under evolving Muslim dynasties.
During his early career as governor of the southern tract of Ghurid Empire, Muhammad subjugated the Oghuz Turks after a series of forays and annexed Ghazni where he was installed by Ghiyath al-Din Muhammad as an independent sovereign. Expanding the Ghurid dominion east of the Indus Delta from his base in Ghazni, Muhammad crossed the river Indus in 1175, approaching it through the Gomal Pass and captured Multan and Uch from the Carmathians within a year. Afterwards, Muhammad took his army by the way of lower Sindh, endeavoring to penetrate into present-day Gujarat through the Thar Desert, only to end up getting wounded and routed near Mount Abu at Kasahrada by a coalition of Rajput chiefs led by the Chaulukya king Mularaja, which forced him to change his route for future inroads into the Indian Plains. Hence, Muhammad pressed upon the Ghaznavids and uprooted them by 1186, conquering the upper Indus Plain along with most of the Punjab. After expelling the Ghaznavids from their last bastion, Muhammad, thus secured the Khyber Pass, the traditional route of entry for invading armies into northern India.
Extending the Ghurid dominion further eastwards into the Gangetic Plain, the Ghurid forces suffered a decisive reverse and Muhammad himself got wounded in engagement with the Rajput Confederacy led by the Chahamana ruler Prithviraj Chauhan at Tarain in 1191. Muhammad returned to Khurasan, and returned a year later with a vast army of mounted archers to secure a decisive victory in the return engagement on the same battleground and executed Prithviraj shortly afterwards. He limited his presence in India afterwards, deputing the political and military operations in the region to a handful of elite slave commanders who swiftly raided local Indian kingdoms and extended the Ghurid influence as far east as the Ganges delta in Bengal and regions to the north in Bihar.
After the death of Ghiyath al-Din Muhammad in 1203, Muhammad of Ghor ascended the throne of Firozkoh as well, becoming the supreme Sultan of the Ghurid Empire. Within a year or so, Muhammad suffered a devastating defeat at Andkhud against their Turkish rivals Khwarazmians aided by timely reinforcements from the Qara Khitais, which resulted in the Ghurid power ebbing out in most of the Khurasan. Muhammad quelled the widespread insurrection throughout his empire after the debacle and ordered the construction of a bridge over the Oxus River to launch a full-scale invasion of Transoxiana in order to avenge his defeat at Andkhud, although a rebellion by the Hindu Khokhars forced him to move towards the Salt Range, where he brutually crushed the Khokhar revolt during his last campaign.
On his way back, Muhammad of Ghor was assassinated on the bank of Indus at Damyak on 15 March 1206, by the Ismāīlī emissaries while offering evening prayers. Muhammad's assassination led to the rapid decline of the Ghurids and enabled Shah Muhammad II to annex remaining Ghurid territories west of the Indus River by 1215. However, his conquests east of the Indus in the Indian Subcontinent, evolved into the formidable Delhi Sultanate under his slave commander Qutbuddin Aibak.