ferdinand was busy in the last decades of his life with the so-called italian wars. he was fighting with the kings of france for control of italy. in 1494, charles viii of france invaded italy and expelled ferdinand's cousin, alfonso ii, from the throne of naples. ferdinand's alliance with various italian princes and with emperor maximilian i, expelled the french by 1496 and installed alfonso's son, ferdinand, on the neapolitan throne. in 1501, following the death of ferdinand ii of naples and his succession by his uncle frederick, ferdinand of aragon signed an agreement with charles viii's successor, louis xii. louis had just successfully asserted his claims to the duchy of milan, and they agreed to partition naples between them, with campania and the abruzzi, including naples itself, going to the french and ferdinand taking apulia and calabria. the agreement soon fell apart, and over the next several years, ferdinand's great general gonzalo fernández de córdoba conquered naples from the french, by 1504. another less famous "conquest" took place in 1502, when andreas paleologus, de jure emperor of the eastern roman empire, left ferdinand and isabella as heirs to the empire, thus ferdinand became de jure roman emperor.