Jaisalmer Fort is situated in the city of Jaisalmer, in the Indian state of Rajasthan. It is believed to be one of the very few "living forts" in the world (such as Carcassonne, France), as nearly one fourth of the old city's population still resides within the fort. For the better part of its 860-year history, the fort was the city of Jaisalmer. The first settlements outside the fort walls, to accommodate the growing population of Jaisalmer, are said to have come up in the 17th century. Jaisalmer Fort is the second oldest fort in Rajasthan, built in 1156 AD by the Rajput Rawal (ruler) Jaisal from whom it derives its name, and stood at the crossroads of important trade routes (including the ancient Silk road).
Legend has it that the fort was built by Rawal Jaisal, a Bhati Rajput, in 1156 CE. The story says that it superseded an earlier construction at Lodhruva, with which Jaisal was unsatisfied and thus, a new capital was established when Jaisal founded the city of Jaisalmer. Around 1299 CE, Rawal Jait Singh I faced a long siege by Alauddin Khalji of Delhi Sultanate, who is said to have been provoked by a Bhati raid on his treasure caravan. By the end of the siege, facing certain defeat, the Bhati Rajput women committed 'Jauhar', and the male warriors under the command of Mularaja met their fatal end in battle with the Sultan's forces. For a few years after the successful siege, the fort remained under the sway of Delhi Sultanate, before being eventually reoccupied by some surviving Bhatis.
The fort is 1,500 ft (460 m) long and 750 ft (230 m) wide and is built on a hill that raises above a height of 250 ft (76 m) above the surrounding countryside. The base of the fort has a 15 ft (4.6 m) tall wall forming the fort's outermost ring, within its triple ringed defence architecture. The fort's upper bastions or towers form a defensive inner-wall perimeter that is about 2.5 mi (4.0 km) long. The fort now incorporates 99 bastions, of which 92 were built or substantially rebuilt between the period of 1633–47. The fort also has four fortified entrances or gates from the townside, one of which was once guarded by cannon.