The last independent Duke of Guelders was Adolf's son Charles of Egmond (1467–1538, r. 1492–1538), who was raised at the Burgundian court of Charles the Bold and fought for the House of Habsburg in battles against the armies of Charles VIII of France, until being captured in the Battle of Béthune (1487) during the War of the Public Weal (also known as the "Mad War"). In 1492, the citizens of Guelders, who had become disenchanted with the rule of Maximilian, ransomed Charles and recognized him as their Duke. Charles, now backed by France, fought Maximilian's grandson Charles of Habsburg (who became Holy Roman Emperor, as Charles V, in 1519) in the Guelders Wars and expanded his realm further north, to incorporate what is now the Province of Overijssel. He was not simply a man of war, but also a skilled diplomat, and was therefore able to keep his independence. He bequeathed the duchy to Duke William the Rich of Jülich-Cleves-Berg (also known as Wilhelm of Cleves). Following in the footsteps of Charles of Egmond, Duke William formed an alliance with France, an alliance dubiously cemented via his political marriage to French King Francis I's niece Jeanne d'Albret (who reportedly had to be whipped into submission to the marriage, and later bodily carried to the altar by the Constable of France, Anne de Montmorency). This alliance emboldened William to challenge Emperor Charles V's claim to Guelders, but the French, mightily engaged on multiple fronts as they were in the long struggle to against the Habsburg "encirclement" of France, proved less reliable than the Duke's ambitions required, and he was unable to hold on to the duchy; in 1543, by the terms of the Treaty of Venlo, Duke William conceded the Duchy of Guelders to the Emperor. Charles united Guelders with the Seventeen Provinces of the Habsburg Netherlands, and Guelders finally lost its independence.