Louis IX of France landed at Damietta in 1249. Egypt would, Louis thought, provide a base from which to attack Jerusalem, and its wealth and supply of grain would keep the crusaders fed and equipped. On June 6 Damietta was taken with little resistance from the Egyptians, who withdrew further up the Nile. Louis was able to build a stockade for the whole Crusade camp with the wood from 24 captured Egyptian trebuchets. The flooding of the Nile had not been taken into account, however, and it soon grounded Louis and his army at Damietta for six months, where the knights sat back and enjoyed the spoils of war. Louis ignored the agreement made during the Fifth Crusade that Damietta should be given to the Kingdom of Jerusalem, now a rump state in Acre, but he did set up an archbishopric there (under the authority of the Latin Patriarch of Jerusalem) and used the city as a base to direct military operations against the Muslims of Syria.