Caracciolo gained most of his experience as a naval officer fighting for the British against the Americans in the War of Independence (1775-83). He returned to Naples in 1781 and, under Nelson, fought the French at Toulon in 1793. Caracciolo continued to fight them even after Ferdinand IV signed an armistice with Napoleon. Later, in 1798, the French captured Naples, and Ferdinand fled to Palermo aboard Nelson's ship, with Caracciolo following behind. During the voyage, a storm arose that nearly caused Nelson's ship to founder, while Caracciolo sailed through it easily; afterward, Ferdinand praised Caracciolo's seamanship, thus allegedly arousing Nelson's jealousy.
Caracciolo returned to Naples (then the French-imposed Parthenopean Republic), perhaps with Ferdinand's permission, because the estates of those who were absent were being seized. Caracciolo was offered command of the Parthenopean navy, which was in a state of disrepair, and he soon turned it into an efficient force. Ferdinand recaptured Naples from the French in 1799. Though the terms of the armistice forbade reprisals, Nelson summarily tried and then hanged Caracciolo for treason aboard his flagship, the Minerva.