necessity of appointing a commander-in-chief capable of training, equipping and disciplining the demoralised Portuguese Royal Army. The Portuguese government asked Britain to appoint Arthur Wellesley to this role, Wellesley indicated he could not do the role justice due to his prior engagements and recommended Beresford. He was appointed Marshal and Commander in Chief of the Army by Decree of 7 March 1809 and took the command on 15th of the same month. At that time, French general Marshal Soult had already crossed into Portugal where he occupied Porto. Beresford quickly overhauled the Portuguese forces, bringing them in line with British discipline and organization, and from the General Headquarters (then at the Largo do Calhariz), he dispatched many "daily orders" altering points of the infantry ordnance, creating a general command of artillery, establishing the separation of the battalions, firing incompetent or corrupt officers and promoting or appointing appropriate replacements. On campaign On 22 April 1809 Sir Arthur Wellesley, later Duke of Wellington, disembarked in Lisbon, and took over the command of all the Anglo-Portuguese troops whereupon Beresford was nominated Marshal General of the Portuguese Army. The allied armies marched to the North. Wellington moved from Coimbra directly to Porto, which he entered on 12 May, and Beresford marched through the Province of Beira, arriving that same day at the banks of the Douro river, in the area of Lamego. Wellington's troops made a forced crossing of the Douro and defeated the French, forcing Marshal Soult to withdraw from Porto. Soult was outnumbered and expelled from Portugal; the positioning of Beresford's forces compelled the French to leave Portugal by the poor roads through Montalegre. They managed to cross the border only after sacrificing their artillery and baggage, and faced numerous difficulties during the evacuation. The Second French Invasion of Portugal was defeated and the allied armies moved back to the South, the British concentrating at Abrantes and the Portuguese at Castelo Branco. With the intention of cooperating with the Spanish against Marshal Victor, the Anglo-Portuguese forces under Wellesley moved into Spain in the Talavera campaign while Beresford remained on the Águeda River covering the Spanish-Portuguese border. After Wellesley's return, now as Viscount Wellington, following the Battle of Talavera, Beresford re-entered Portugal, where he distributed the army at various locations and established his General Headquarters in Lisbon. From Lisbon he dispatched numerous orders and instructions for the reform of the Portuguese military. In