<P> The Ayyubid ruler of Syria, Al - Mu'azzam, who until that time had been determined to rehabilitate fortifications and buildings in Jerusalem, decided to systematically destroy the Crusader fortifications in the Levant in general and Jerusalem in particular . The Sultan's command to raze the town to the ground seemed so implausible that it took the personal presence of Al - Mu'azzam in Jerusalem to carry it out . The city suffered two waves of destruction in 1219 and 1220 . This was absolute and brutal destruction, with most buildings in Jerusalem and its walls destroyed, and led to severe reactions from the inhabitants of Jerusalem, who thought that it was Judgment Day . Muslim women of Jerusalem cut their hair in a sign of mourning at the plaza on the Temple Mount . The vast majority of the population, including the Jewish community, left Jerusalem, and all that remained standing in the city were the Tower of David Citadel, Church of the Holy Sepulchre, and the sacred Muslim domain of the Temple Mount . </P> <P> Attempts to restore Christian power in Jerusalem during the 1190s to 1210s were unsuccessful . </P> <P> The Sixth Crusade led by Frederick II, Holy Roman Emperor left Italy in 1228 . The death of al - Mu'azzam negated the proposed alliance with al - Kamil, who along with his brother al - Ashraf had taken possession of Damascus (as well as Jerusalem) from their nephew, al - Mu'azzam's son an - Nasir Dawud . However, al - Kamil presumably did not know of the small size of Frederick's army, nor the divisions within it caused by his excommunication, and wished to avoid defending his territories against another crusade . Frederick's presence alone was sufficient to regain Jerusalem, Bethlehem, Nazareth, and a number of surrounding castles without a fight: these were recovered in February 1229, in return for a ten - year truce with the Ayyubids and freedom of worship for Jerusalem's Muslim inhabitants . The terms of the treaty were unacceptable to the Patriarch of Jerusalem Gerald of Lausanne, who placed the city under interdict . In March, Frederick crowned himself in the Church of the Holy Sepulchre, but because of his excommunication and the interdict Jerusalem was never truly reincorporated into the kingdom, which continued to be ruled from Acre . </P> <P> The treaty with the Ayyubids was set to expire in 1239 . Plans for a new crusade to be led by Frederick came to nothing, and Frederick himself was excommunicated by Gregory IX again in 1239 . However, other European nobles took up the cause, including Theobald IV, Count of Champagne and King of Navarre, Peter of Dreux, and Amaury VI of Montfort, who arrived in Acre in September 1239 . Theobald was elected leader of the crusade at a council in Acre, attended by the most of the important nobles of the kingdom, including Walter of Brienne, John of Arsuf, and Balian of Sidon . The crusaders may have been aware of the new divisions among the Ayyubids; al - Kamil had occupied Damascus in 1238 but had died soon afterwards, and his territory was inherited by his family . His sons al - Adil abu Bakr and as - Salih Ayyub inherited Egypt and Damascus . </P>

Who had jerusalem at the end of the crusades