When Ferrante died in 1494, Charles VIII of France invaded Italy, using as a pretext the Angevin claim to the throne of Naples, which his father had inherited on the death of King René's nephew in 1481.
This began the Italian Wars.

Charles VIII expelled Alfonso II of Naples from Naples in 1495, but was soon forced to withdraw due to the support of Ferdinand II of Aragon for his cousin, Alfonso II's son Ferrantino.
Ferrantino was restored to the throne, but died in 1496, and was succeeded by his uncle, Frederick IV.

Charles VIII's successor, Louis XII reiterated the French claim.
In 1501,  he occupied Naples and partitioned the kingdom with Ferdinand of Aragon, who abandoned his cousin King Frederick.
The deal soon fell through, however, and Aragon and France resumed their war over the kingdom, ultimately resulting in an Aragonese victory leaving Ferdinand in control of the kingdom by 1504.

The Spanish troops occupying Calabria and Apulia, led by Gonzalo Fernandez de Cordova did not respect the new agreement, and expelled all Frenchmen from the area.
The peace treaties that continued were never definitive, but they established at least that the title of King of Naples was reserved for Ferdinand's grandson, the future Charles V, Holy Roman Emperor.
Ferdinand nevertheless continued in possession of the kingdom, being considered as the legitimate heir of his uncle Alfonso I of Naples and also to the former Kingdom of Sicily (Regnum Utriusque Siciliae).

The kingdom continued as a focus of dispute between France and Spain for the next several decades, but French efforts to gain control of it became feebler as the decades went on, and never genuinely endangered Spanish control.

The French finally abandoned their claims to Naples by the Treaty of Cateau-Cambrésis in 1559.

In the Treaty of London (1557), five cities on coast of Tuscany were designated the Stato dei Presidi (State of the Presidi), and part of the Kingdom of Naples.
When Ferrante died in 1494, Charles VIII of France invaded Italy, using as a pretext the Angevin claim to the throne of Naples, which his father had inherited on the death of King René's nephew in 1481. This began the Italian Wars.
Charles VIII expelled Alfonso II of Naples from Naples in 1495, but was soon forced to withdraw due to the support of Ferdinand II of Aragon for his cousin, Alfonso II's son Ferrantino. Ferrantino was restored to the throne, but died in 1496, and was succeeded by his uncle, Frederick IV.
Charles VIII's successor, Louis XII reiterated the French claim. In 1501,  he occupied Naples and partitioned the kingdom with Ferdinand of Aragon, who abandoned his cousin King Frederick. The deal soon fell through, however, and Aragon and France resumed their war over the kingdom, ultimately resulting in an Aragonese victory leaving Ferdinand in control of the kingdom by 1504.
The Spanish troops occupying Calabria and Apulia, led by Gonzalo Fernandez de Cordova did not respect the new agreement, and expelled all Frenchmen from the area. The peace treaties that continued were never definitive, but they established at least that the title of King of Naples was reserved for Ferdinand's grandson, the future Charles V, Holy Roman Emperor. Ferdinand nevertheless continued in possession of the kingdom, being considered as the legitimate heir of his uncle Alfonso I of Naples and also to the former Kingdom of Sicily (Regnum Utriusque Siciliae).
The kingdom continued as a focus of dispute between France and Spain for the next several decades, but French efforts to gain control of it became feebler as the decades went on, and never genuinely endangered Spanish control.
The French finally abandoned their claims to Naples by the Treaty of Cateau-Cambrésis in 1559.
In the Treaty of London (1557), five cities on coast of Tuscany were designated the Stato dei Presidi (State of the Presidi), and part of the Kingdom of Naples.
Kingdom of Naples