After the victory of the Muslims in the Battle of Hattin on July 4, 1187, almost all the cities and citadels of the Kingdom of Jerusalem were conquered by the Muslim army led by Saladin. On September 17, Muslim troops came against the walls of Jerusalem, and on September 20, Saladin himself at the head of his army besieged Jerusalem, which contained about 30,000 residents and another 30,000 refugees from around the Christian Holy Land. The siege was relatively short but intense and violent, as both sides saw the city as their religious and cultural center. After bitter fighting, the Muslims were able to undermine the city's fortifications in the area between Damascus Gate and Herod's Gate, near where the Crusaders broke into the town in 1099. The defenders realized that they were doomed, and that it was not possible to maintain the Christian conquest of Jerusalem. At the request of the Latin Patriarch Hiraklios, and probably under pressure from the civilian population, the Christians decided to enter into negotiations with Saladin, leading to a conditional surrender. The Crusaders threatened to harm the Islamic holy sites on the Temple Mount, the Dome of the Rock and Al-Aqsa Mosque if the blockade continued. This threat, combined with pressure from the Muslim battalion commanders to end the fighting, led to the signing of a contract which surrendered the city to Saladin, making the residents prisoners of war who could redeem themselves for a fee.