In 1187 the struggle for control of Jerusalem stood at the center of a much larger conflict in the eastern Mediterranean. Saladin, the Ayyubid ruler, gathered forces against the Crusader states. In July his army defeated the main Crusader force at the Battle of Hattin, opening the way toward Jerusalem.
The city was then placed under pressure, and negotiations followed. In October 1187 Jerusalem surrendered to Saladin's forces. Under the negotiated terms, the city's Latin Christian inhabitants could leave on payment of a ransom. Many were ransomed or released, while thousands who could not pay were taken captive. Saladin's largely peaceful entry was often contrasted with the massacre that had followed the Crusader capture of the city in 1099. The event mattered far beyond one city: Jerusalem was a sacred place for Judaism, Christianity, and Islam, so its change of political control carried enormous religious and symbolic weight.