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.
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.