Ala-ud-din Khilji attacked and captured the fort in the 13th century and managed to hold it for 9 years. During the siege of the fort the Rajput women committed Jauhar. The second battle at the fort happened in 1541, when Mughal emperor Humayun attacked the fort city.
With the advent of British rule, the emergence of maritime trade and the growth of the port of Bombay led to the gradual economic decline of Jaisalmer.
After independence and the Partition of India, the ancient trade route was totally closed, thus sealing the fate of the city. Nonetheless, the continued strategic importance of Jaisalmer was demonstrated during the 1965 and 1971 wars between Indiaand Pakistan
Although at one point the entire population ofJaisalmer lived within the fort, it today has a resident population of about 4,000 people who are largely from the Brahmin and Daroga communities. They are mostly descendants of the workforce of the Bhati rulers of Jaisalmer which was permitted to reside within the fort’s premises.
With an increase in population, people gradually relocated to the foot of the Trikuta Hill and the town of Jaisalmer spread out from the fort.