The Jalali castle is located in Kashan, Iran.
The walls around Kashan were built originally by Zobeyde Khatun, Harun al-Rashid’s wife. She sponsored many developmental activities in the different cities of Islamic countries. Early in the Seljukid era, Malik-Shah I ordered the repair of the walls and the strengthening of two of its castles and that the Jalali castle be built in the western part of the city. According to some historical documents there was a moat around the castle in that time. The castle, tower and ramparts around the city of Kashan have protected its people very well down the centuries. For example in 1138, Malek-Seljuk sieged Kashan for three months, but because of the strong fortification of Kashan, he could not capture the city and only destroyed some of the neighbouring villages. In 1198, Miajegh, the khwarazmid commander launched a military campaign against Kashan.