Between 1806-1807 the United Kingdom invaded the River Plate in South America which were still part of Spain. The first invasion had several contingents, totaling about 1,700 soldiers. This was followed up with a second of up to 14,000 men, twenty warships and ninety transports. They initially occupied Buenos Aires and later Montevideo but were defeated by the Spanish colonial militias. As these victories were gained with minimal help from Spain, they provided a catalyst for the growth of discontent with Spanish rule in the River Plate. George Canning as Foreign Office secretary (1807–09) became deeply involved in the affairs of Spain, Portugal and Latin America.