Sir John Moore, the British commander
In early October 1808, following the scandal in Britain over the
Convention of Sintra and the recall of the generals
Wellesley, Sir John Moore took command of the 30,000-man British force in Portugal. In addition,
Sir David Baird in command of an expedition of reinforcements out of
Falmouth consisting of 150 transports carrying between 12,000 and 13,000 men, convoyed by HMS Louie,
Champion, entered Corunna Harbour on the 13 October. By November 1808 the British army, led by Moore, advanced into Spain with orders to assist the Spanish armies in their struggle against the invading forces of
After the surrender of a French army corps at
 and the loss of Portugal, Napoleon was convinced of the peril he faced in Spain. Deeply disturbed by news of Sintra, the Emperor remarked,
I see that everybody has lost their head since the infamous capitulation of Bailén. I realise that I must go there myself to get the machine working again.
The French, all but masters of Spain in June, stood with their backs to the
Pyrenees, clutching at
Catalonia. They did not know if even these two footholds could be maintained in the face of a Spanish attack. By October French strength in Spain, including garrisons, was about 75,000 soldiers. They were facing 86,000 Spanish troops with Spain's 35,000 British allies en route.
However, no attack came. The Spanish social fabric, shaken by the shock of rebellion, gave way to crippling social and political tensions; the patriots stood divided on every question and their nascent war effort suffered accordingly. With the fall of the monarchy, constitutional power devolved to local
juntas. These institutions interfered with the army and the business of war, undermined the tentative central government taking shape in Madrid,
 and in some cases proved almost as dangerous to each other as to the French.
[b] The British Army in Portugal, meanwhile, was itself immobilized by
logistical problems and bogged down in administrative disputes, and did not budge.
Months of inaction had passed at the front, the revolution having "temporarily crippled Patriot Spain at the very moment when decisive action could have changed the whole course of the war".
 While the allies inched forward, a vast consolidation of bodies and bayonets from the far reaches of the French Empire brought 100,000 veterans of the
Grande Armée into Spain, led in person by Napoleon and his
Marshals. With his Armée d'Espagne of 278,670 men drawn up on the Ebro, facing a scant 80,000 raw, disorganized Spanish troops, the Emperor announced to the Spanish deputies:
I am here with the soldiers who conquered at
Eylau. Who can withstand them? Certainly not your wretched Spanish troops who do not know how to fight. I shall conquer Spain in two months and acquire the rights of a conqueror.
Starting in October 1808 Napoleon led the French on a brilliant
 offensive involving a massive
double envelopment of the Spanish lines. The attack began in November and has been described as "an avalanche of fire and steel".
For a time the British army was dangerously dispersed, with Baird's newly arrived contingent at
Astorga to the north, Moore at
Hope 70 miles (110 km) to the east near Madrid with all Moore's cavalry and artillery. The main army, under Moore, had advanced to Salamanca and were joined by Hope's detachment on 3 December when Moore received news that the Spanish forces had suffered several defeats. He considered that to avoid disaster he must give up and retreat back to Portugal.
Moore, before retreating, received intelligence of Soult's 16,000 man corps' scattered and isolated position at
Carrión and that the French were unaware of the British army's position. On 15 December, he seized this opportunity to advance on the French near Madrid, hoping that to defeat Soult and possibly divert Napoleon’s forces.
 A junction with Baird on 20 December, advancing from Corunna, raised Moore's strength to 23,500 infantry, 2,400 cavalry and 60 guns
 and he opened his attack with a successful raid by
Paget's cavalry on the French
Sahagún on 21 December. However, Moore failed to follow up against a surprised Soult. Moore halted for two days and allowed Soult to concentrate his corps.