Freire joined fellow Spaniards in fighting against invading Napoleonic forces, and on 15 September 1807, took command (as colonel) of a volunteer cavalry regiment in Madrid. The following year he saw action in Extremadura and other locations. He was promoted to brigadier on 2 March 1809 after a campaign in La Mancha, and to field marshal after the Battle of Talavera. On 10 January 1810, he was appointed commander of cavalry under Juan Carlos de Aréizaga and led them at Ocaña on 19 November, a devastating defeat that cost the Spanish control of Andalusia. He wrote a manual revising Spanish cavalry tactics, published in Murcia in 1813.