:For the Mexican town, see Castaños.
Following the French invasion of 1808, Ballasteros took command of a regiment from the Junta General del Principado de Asturias and attached himself to the Army of Galicia under Blake and Castaños.
Apart from the odd setback, such as General Castaños' surprise victory at Bailén, in part due to guerrilla warfare between Madrid and Andalusia, and especially in the Sierra Morena, a victory which helped persuade the British government that Napoleon could be defeated, the French troops were largely undefeated on the open battlefield.
Establishing his headquarters there, he was joined shortly afterwards by La Peña's 10,000 men and, on 17 October, by Castaños.