Origin of spanish
Spanish reaches English through Middle English and Spanish. Spanish today means “The people of Spain, collectively; Spaniards”.
Etymology of spanish
Inherited from Middle English Spanisch, either an alteration of Spaynisch after foreign words for "Spain" or "Spanish" such as Old Spanish Espanna, Old Spanish espannol or a partial calque of them; equivalent to Spain + -ish. Sense of "licorice" derives from a local legend in Pontefract, West Yorkshire, where twigs that washed up onto the beaches from the wreckage of a galleon from the Spanish armada were found to be licorice roots.
Etymology text from Wiktionary (CC BY-SA 4.0). Asterisked forms are reconstructed, not attested.