Following the loss of Madrid to Napoleon at the Battle of Somosierra the situation in Spain became more desperate and Cuesta was allowed to reconstitute the Army of Extremadura in order to defend the southern frontier. In defiance of the military wisdom of the time Cuesta pursued an offensive as soon as he had constructed a fighting force. This met with success. In January and February 1809, all of Badajoz was reclaimed from the French.