In 1301 Alauddin Khalji, the ruler of the Delhi Sultanate in India, conquered the neighbouring kingdom of Ranastambhapura (modern Ranthambore).
Hammira, the Chahamana (Chauhan) king of Ranthambore, had granted asylum to some Mongol rebels from Delhi in 1299. He refused requests to either kill these rebels or hand them over to Alauddin, resulting in an invasion from Delhi. Hammira lost his general Bhimasimha to an army led by Alauddin's general Ulugh Khan, and his brother Bhoja defected to Alauddin some days later. After recovering from these initial reverses, Hammira's generals (including the Mongol rebels) defeated Ulugh Khan's army at a mountain pass near Ranthambore. Alauddin then dispatched his general Nusrat Khan to reinforce Ulugh Khan's army, but Nusrat Khan was killed while besieging the fort.
Alauddin then himself took control of the operations at Ranthambore. He ordered the construction of a mound to scale its walls. After a long siege, the defenders suffered from a famine and defections. Facing a desperate situation, in July 1301, Hammira and his loyal companions came out of the fort, and fought to death. His wives, daughters and other female relatives committed Jauhar (mass self-immolation). Alauddin captured the fort, and appointed Ulugh Khan as its governor.
Ranthambore was reputed to be an impregnable fort, and Alauddin's predecessor Jalaluddin had made an unsuccessful attempt to capture it in 1291.
In 1299, Alauddin Khalji sent his generals Nusrat Khan and Ulugh Khan to capture Gujarat. This army included several Mongol soldiers (also called Mughals or neo-Muslims), who had converted to Islam recently. When the army was returning to Delhi after its successful campaign, some of the Mongols staged a mutiny against the generals, near Jalore. The mutiny was crushed, and the army returned to Delhi. Two rebel Mongol leaders — Muhammad Shah and Kabhru — managed to escape with some of their followers. Hammira of Ranthambore (called Hamir Dev in Muslim chronicles) granted asylum to these Mongol fugitives.