As the war progressed the Spanish suffered a series of defeats on land in the War of the Pyrenees, and in the summer of 1795 Spain was forced to sign a peace treaty with the French, withdrawing their forces from the Mediterranean campaign. Britain and France fought inconclusive sea battles at Genoa and the Hyères Islands that year, the campaign settling into a stalemate, with the French blockaded in Toulon but sending successful raiding squadrons against British trade. One such squadron destroyed a large British convoy at the Battle of the Levant Convoy off Cape St. Vincent in October 1795 and took shelter in the main Spanish naval base of Cádiz. During 1796 the Italian campaigns of Napoleon Bonaparte systematically eliminated Britain's Italian allies, while diplomatic negotiations brought Spain into an alliance with France, signing the Treaty of San Ildefonso in August. On 5 October Spain declared war on Britain and a large Spanish fleet sailed from Cádiz under Lángara to unite with the French at Toulon.