At the beginning of the Peninsular War (1807–14) France and Spain signed the Treaty of Fontainebleau in October 1807. This provided for the invasion and subsequent division of Portuguese territory into three kingdoms. Subsequently, French troops under the command of General Junot entered Portugal, which requested support from the British. In July 1808 troops commanded by Sir Arthur Wellesley, the later Duke of Wellington, landed in Portugal and defeated French troops at the Battles of Roliça and Vimeiro. This forced Junot to negotiate the Convention of Cintra, which led to the evacuation of the French army from Portugal. In March 1809, Marshal Soult led a new French expedition that advanced south to the city of Porto before being repulsed by Portuguese-British troops and forced to withdraw. After this retreat, Wellesley's forces advanced into Spain to join 33,000 Spanish troops under General Cuesta. At Talavera, some southwest of Madrid, they encountered and defeated 46,000 French soldiers under Marshal Claude Victor. After the Battle of Talavera, Wellington realised that he was seriously outnumbered by the French army, giving rise to the possibility that he could be forced to retreat to Portugal and possibly evacuate. He decided to strengthen the proposed evacuation area around the Fort of São Julião da Barra on the estuary of the River Tagus, near Lisbon.