The last two dukes to directly rule the duchy, Philip the Good (r. 1419–1467) and Charles the Bold (r. 1467–1477), attempted to secure the independence of their state from the French crown. The endeavour failed; when Charles the Bold died in battle leaving no sons, Louis XI of France declared the duchy escheated and absorbed the territory into the French crown. Charles's daughter, Mary, inherited the rest of his domain and claimed the Duchy of Burgundy. Her heirs called themselves dukes of Burgundy, refusing to accept the loss of the duchy. The War of the Burgundian Succession took place from 1477 to 1482. Eventually, King Louis XI of France and Archduke Maximilian of Austria, Mary's widower, signed the Treaty of Arras (1482). Maximilian recognised the annexation of the two Burgundies and several other territories. France retained most of its Burgundian fiefdoms except for the affluent County of Flanders, which passed to Maximilian and Mary's descendants (but soon rebelled). With the 1493 Treaty of Senlis, Maximilian regained for his and Mary's descendants the County of Burgundy, Artois and Charolais, but the Duchy of Burgundy and Picardy were lost definitively to France.