At the end of the eleventh century, after a hiatus of just over four and a half centuries, Jerusalem came once again under Christian rule. On 15 July 1099, at the conclusion of a six-week siege, the armies of the First Crusade broke into the city, massacred many of the local inhabitants, expelled those non-Christians who survived and appointed Godfrey of Bouillon as ruler of the Frankish Kingdom of Jerusalem. For eighty-eight years, Jerusalem served as capital of the kingdom until it was reconquered by the Ayyubids under Saladin on 2 October 1187. In the thirteenth century, from 18 February 1229 until August 1244, the city was again briefly in the hands of the Franks as the result of a treaty between Emperor Frederick II and the Ayyubid sultan al-Kamil. These two periods of Frankish rule are a short phase in the history of the city, yet one that brought about substantial changes to its physical makeup, its institutions, population and the role Jerusalem played in the region and the world. The extent of the changes was to a large measure due to the desire of Frankish leadership to re-establish Jerusalem as a Christian city and to glorify it in a manner appropriate to the holiest site of Christianity. They were also the outcome of the very practical need to enable Jerusalem to serve as the administrative capital of a kingdom and to revive the city as a viable one after it had been emptied of most of its former population.