GUIRI is a colloquial Spanish slur used in Spain applied to foreign tourists, particularly from countries in northern Europe or the Anglosphere.
According to the Real Academia Dictionary, this word can be traced back to 19th century Carlist Wars in the form “guiristino”, the pronunciation of Basque-speaking Carlist forces of the name of their enemies, the Cristinos (after regent Queen María Cristina). It entered the Diccionario de la lengua española de la Real Academia Española in 1925. When a “guiri” would be the term used by the opposing political parties of the time, later to be exclusively used for the Guardia Civil and Policía Armada (Armed Police) under the Francoist régime.
There is another theory by Juan Goytisolo that guiri is a neologism from Caló language which derives from Moroccan and Algerian Arabic gaouri (a word with a similar meaning applying to Europeans), which in turn stems from Ottoman Turkish gâvur.