Military history of the Crusader states
The Seljuk–Crusader War began when the First Crusade wrested territory from the Seljuk Turks during the Siege of Nicaea in 1097 and lasted until 1128 when Zengi became atabeg of Aleppo. At the latter date, the chief threat to the Crusaders from the east and north became the Zengids. The conflict was generally fought between European Crusaders and the Seljuk Turks and their vassals. The Muslim Syrian emirates occasionally allied themselves with the Christians against rival states.
Crusades
Following Innocent III's Fourth Council of the Lateran, crusading resumed in 1217 against Saladin's Ayyubid successors in Egypt and Syria for what is classified as the Fifth Crusade. Led by Andrew II of Hungary and Leopold VI, Duke of Austria, forces drawn mainly from Hungary, Germany, Flanders, and Frisia achieved little. Leopold and John of Brienne besieged and captured Damietta but an army advancing into Egypt was compelled to surrender. Damietta was returned and an eight-year truce agreed. Frederick II, Holy Roman Emperor, was excommunicated for breaking a treaty obligation with the Pope that required him to lead a crusade. However, since his marriage to Isabella II of Jerusalem gave him a claim to the kingdom of Jerusalem, he finally arrived at Acre in 1228. Frederick was culturally the Christian monarch most empathetic to the Muslim world, having grown up in Sicily, with a Muslim bodyguard and even a harem. His great diplomatic skills meant that the Sixth Crusade was largely negotiation supported by force. A peace treaty was agreed upon, giving Latin Christians most of Jerusalem and a strip of territory that linked the city to Acre, while the Muslims controlled their sacred areas. In return, an alliance was made with Al-Kamil, Sultan of Egypt, against all of his enemies of whatever religion. The treaty and suspicions about Frederick's ambitions in the region made him unpopular, and he was forced to return to his domains when they were attacked by Pope Gregory IX. While the Holy Roman Empire and the Papacy were in conflict, it often fell to secular leaders to campaign. What is sometimes known as the Barons' Crusade was led by Theobald I of Navarre and Richard of Cornwall; it combined forceful diplomacy and the playing of rival Ayyubid factions off against each other. This brief renaissance for Frankish Jerusalem was illusory, being dependent on Ayyubid weakness and division following the death of Al-Kamil.