During 1794 and 1795 the Spanish suffered a series of defeats in the War of the Pyrenees, and in August 1795 they signed a peace treaty with France, removing their forces from the Mediterranean campaign. Inconclusive fighting that year between British and French fleets at the Battle of Genoa and the Battle of the Hyères Islands led to a stalemate, the French under blockade at Toulon sending raiding squadrons against British trade. During 1796 the Italian campaigns of Napoleon Bonaparte eliminated Britain's Italian allies, while diplomatic negotiations brought Spain into an alliance with France in August, through the Treaty of San Ildefonso. On 5 October Spain declared war on Britain and a large Spanish fleet united with the French at Toulon.