 The situation changed dramatically after the Franco-Spanish defeat at Trafalgar; John grew bolder and officially resumed diplomatic and trade relations with Britain.Unhappy with this change of policy by the Portuguese government, Napoleon negotiated a secret treaty with Charles IV of Spain and sent an army to invade Portugal.On 17 October 1807, 24,000 French troops under General Junot crossed the Pyrenees with Spanish cooperation and headed towards Portugal to enforce Napoleon's orders.