In 1796 , after three years of the French Revolutionary Wars , Spain and the French Republic signed the Treaty of San Ildefonso . The secret terms of this treaty required Spain to renounce its alliance with Great Britain and subsequently to declare war on its former ally . In the East Indies this shift of political allegiance meant that the dominant British forces in the region were faced with the threat of attack from the Spanish Philippines to the east . Britain dominated the East Indies in 1796 , controlling the trade routes through the Indian Ocean from the ports of Bombay , Madras and Calcutta . Dutch Ceylon , the Dutch Cape Colony and parts of the Dutch East Indies had been captured in 1795 , and the French presence in the region had been confined to Île de France and a few subsidiary islands in the Western Indian Ocean .