Gaeta his beachhead for the conquest of the Kingdom of Naples in 1435, besieged it, and to his own disadvantage displayed great generosity, by aiding those unable to bear arms who had been driven out from the besieged town. After a disastrous naval battle he captured it, and gained control of the kingdom. He enlarged the castle, which became his royal palace, and created a mint. In 1451 the city was home to the Treaty of Gaeta, stipulated between Alfonso V and the Albanian lord, Skanderbeg: the treaty ensured protection of the Albanian lands in exchange for political suzerainty of Skanderbeg to Alfonso.
Modern era
In 1495, king Charles VIII of France conquered the city and sacked it. The following year, however, Frederick I of Aragon regained it with a tremendous siege which lasted from September 8 to November 18.
In 1501 Gaeta was retaken by the French; however, after their defeat at the Garigliano (January 3, 1504), they abandoned it to Gonzalo Fernández de Córdoba, Ferdinand the Catholic's general.
In 1528 Andrea Doria, admiral of Charles V, defeated a French fleet in the waters off Gaeta and gave the city to its emperor. Gaeta was thenceforth protected with a new and more extensive wall, which also encompassed Monte Orlando.
In the War of the Spanish Succession, on September 30, 1707 Gaeta was stormed and taken after a three-month siege by the Austrians under General Daun. On 6 August 1734 it was taken by French, Spanish and Sardinian troops under the future King Charles of Naples after a stubborn defense by the Austrian viceroy of four months. Charles' own daughter Infanta Maria Josefa of Spain was born here in 1744. The fortifications were again strengthened; and in 1799 it was temporarily occupied by the French.
On July 18, 1806 it was captured by the French under André Masséna, after an heroic defence. It was created a duché grand-fief in the Napoleonic Kingdom of Naples, but under the French name Gaete,