Excerpts from Books and Wikipedia
"The Sultan al-Kamil offered to return Jerusalem to Christian control in exchange for Damietta, but the offer was refused. The following spring the crusaders began their planned advance of Cairo, but they moved too slowly and were trapped by the Nile's summer flood. They were forced to surrender Damietta as the price of their release." [1001 Days] " By the end of August, the Crusaders were hungry, thirsty, and discouraged. They decided to retreat back towards Damietta, but by this point the Nile was in full flood, and al-Kamil ordered the sluice gates that lined the Crusader path back to Damietta opened. Their way was flooded and impassable, except for one narrow road blocked by al-Kamil’s army. The Crusaders were trapped; and that was the end of the Fifth Crusade. Al-Kamil could have slaughtered the pinned army, but he accepted their offer to hand over Damietta in exchange for their lives. To guarantee that Damietta would be surrendered, the Crusaders handed over twenty hostages (including the senior papal legate Pelagius, who was not particularly popular at that moment). They went back to Damietta, collected their belongings, and went home."