 In 1698, he was appointed Governor of Milan.In 1700, the last Habsburg king of Spain, Charles II, died.Charles was replaced by Louis XIV's grandson, Philip, Duke of Anjou, triggering the War of Spanish Succession in which the territory around Milan was one of the major battlefields.