Updated: Jun 25, 2022
Britain and Spain have usually been enemies (Spanish Armada in 1588 when Spain tried to invade England, and War of the Spanish Succession [1701-1714]). But during the Peninsular War, they became allies when Napoleon invaded Spain and put his brother on the Spanish throne in early 1808. Spain and France had been allies before this when Napoleon invaded Portugal via Spain in 1807. The UK came to Portugal and, later, Spain's aid. Things came to a head in May when the Spanish tried to resist. There's a famous painting, The Third of May 1808, by Francisco Goya that commemorates the shooting of the Spanish resistance. Although it's known as the Peninsular War in Britain, in Spain it's known as the War of Independence. Most of the brutal fighting between Britain (allies, Portugal, Spain) and France and its allies took place in northern Spain. The French won a lot of battles. In January 1810, the French invaded Andalusia in the south.
My book is set in spring 1810 when Gibraltar was a bastion and help to Cadiz where the Spanish Cortes (court) and Junta (administrative body) were being besieged. The British navy was the entity keeping the French from invading by sea. The French were in most large cities in Andalusia, including smaller towns like Malaga and Fuengirola, two places that I knew well when I lived in Gibraltar. Of course, I didn't know any of this history but as a teenager was more interested in the shops in Malaga and the beaches of Fuengirola.