In 1796 Spain signed the treaty of San Ildefonso with France, making peace and later entering the war against Britain. Gravina served in a squadron under Don Jose de Mazarredo. In 1801 he was sent to San Domingo in the West Indies in command of the Spanish fleet during the Haiti expedition under the French General Charles Leclerc.