In 1812 Wellington had defeated the French in western Spain at the battle of Salamanca. He had occupied Madrid and laid siege to Burgos.
Despite this setback King Joseph was able to gather a large army and drive Wellington back to Salamanca.
In January 1813 orders arrived from Napoleon to send many of the best French divisions north to rebuild the Grand Armee, which was lost in the terrible retreat from Russia. King Joseph was relieved of the command of all French armies in Spain. Marshal Soult would command in western Spain and Marshal Suchet in eastern Spain.
Marshal Soult was ordered to abandon Andalusia and march his army north to replace the troops sent to Germany. He would hold the area from Madrid to Bayonne and cooperate with Marshal Suchet in eastern Spain.
The Duke of Wellington was soon aware that the French armies in Spain had been greatly reduced in number. In January 1813 he was appointed to command all allied troops in Spain, including all Spanish armies.
In May 1813 he issued his orders for the coming campaign.
Captain-General Copons would command the four Spanish armies in the east. He would create a diversion, which would pin Suchet in the east and prevent him sending any reinforcements to Soult.
The main offensive would be in the west. He would lead his own Anglo Portuguese army back to Burgos, defeat Soult and drive him out of Spain.
Fifth French Army was widely spread throughout western Spain as follows
6th corps at Burgos
7th corps at Valladolid
8th Corps at Madrid
16th corps at Santander
Wellington has concentrated his army in and around Salamanca
1st corps in reserve at Salamanca
2nd corps at Avila to guard against an advance from Madrid
3rd corps opposite Valladolid pinning 7th French corps
4th corps ready to cross the river Douro at Zamora
The campaign would start on 13 July 1813.