Seventh Crusade
Louis IX of France invaded Egypt and took Damietta but was crushed at Mansurah and captured; he was released for a ransom.

Mahiet · Public domain · Source
When Jerusalem fell to Muslims again in 1244, Louis IX took the cross. He seized Damietta easily in June 1249, but in February 1250 his cavalry was drawn into street fighting at Mansurah and destroyed, and the king himself was captured during the retreat in April.
In the turmoil the Mamluks, Egypt’s slave soldiers, killed the Ayyubid sultan and took power, founding the Mamluk Sultanate. Released, Louis stayed at Acre until 1254 repairing the walls of the coastal towns.