The Crusades were Catholic Church sanctioned military campaigns during the Middle Ages, beginning with pleas from the Byzantine Empire, under Alexius I, to the Pope to help with the Turkish threat in Constantinople, in 1095 AD. The last Crusade was undertaken in the 15th Century and meant to counter the expansion of the Ottoman Empire. The First Crusade resulted in the creation of four Crusader States – County of Edessa, Principality of Antioch, County of Tripoli and Kingdom of Jerusalem.
Frederick II was ambitious and many modern historians call him “the first modern ruler” because of the efficient centralized government system he established in Sicily and southern Italy. When he was three, he was crowned King of Sicily and co-ruled with his mother. He was King of Germany, Burgundy and Italy when he was 18. With his papal coronation in 1220 AD, he became ruler of the Holy Roman Empire until his death in 1250. In 1225, he married Yolande of Jerusalem, the daughter of the nominal ruler of the Kingdom of Jerusalem, John of Brienne. As such, he had a compelling reason to want to restore the kingdom.
In 1227, Gregory IX was elected pope and Frederick left Italy for Acre, the capital of the Kingdom of Jerusalem, to begin another crusade. An epidemic struck and Frederick was forced to turn back, which resulted in Pope Gregory excommunicating him. Despite the actions of the pope, Frederick left for Syria in 1228 and arrived at Acre in September to reclaim Jerusalem from the Ayyubid Empire, officially beginning the Sixth Crusade.
The Sixth was mostly political maneuvering instead of actual fighting, which is why it continued from 1228-1239 and again from 1241-1244. Frederick took what forces he had to Acre and the sultan of Egypt, al-Kamil, who ruled over Jerusalem as part of the Ayyubid Empire, was dealing with rebels in Syria and ceded the city to the Franks. This was done through the Treaty of Jaffa and Tell Ajul on February 18, 1229 AD, but made numerous stipulations about the city, and safeguarded the truce for ten years. Frederick entered Acre on March 17, 1229 and was crowned King the next day. Having other matters to attend to back home, Frederick left Jerusalem in May 1229, leaving Latin Christians to rule most of Jerusalem and a strip of land from Acre to Jerusalem, with Muslims still retaining control of the holy areas of Jerusalem itself. The Sixth Crusade ended on October 17, when an Egyptian-Khwarismian force under the command of al-Kamil’s son, al-Salih Ayyub, nearly annihilated the Frankish army at Gaza and forcibly took back Jerusalem from the Christians in less than 48 hours.