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 into South Asia, 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, endeavouring to penetrate into present-day Gujarat through the Thar Desert. However, he was wounded and his forces were routed near Mount Abu at Kasahrada by a coalition of Rajput chiefs led by the Chaulukya king Mularaja. This setback forced him to change his route for future inroads into the Indian Plains. Hence, Muhammad pressed his forces against 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 secured the Khyber Pass, the traditional route of entry for invading armies into northern India.