In 1477, Charles the Bold died at the Battle of Nancy. Immediately Louis XI of France entered Hainaut with 7000 men at arms and a powerful artillery. He stood before Le Quesnoy on 23 May 1477 but was repelled. He returned some time later and succeeded after intense bombardment (nearly 900 balls thrown) to take the town, leaving his fair archers to rush through the open breach, but torrential rain halted the fighting. However, the town surrendered the next day and preferred to pay 900 gold crowns to prevent looting: the King of France had lost 500 men at arms in the venture! The same year the young duchess Mary of Burgundy married Maximilian of Austria, head of the house of Habsburg, and in 1478 his troops drove the French out of the county of Hainaut. Antoine de Chabannes, who had been given custody of the town in 1477 by Louis XI, found himself in a hurry to get away.