1896, from Spanish flamenco, first used of Gypsy dancing in Andalusia. The word means "Fleming, native of Flanders" (Dutch Vlaming) and also "flamingo."
Speculation are varied and colorful about the connection between the bird, the people, and the gypsy dance of Andalusia. Spain ruled Flanders for many years, and King Carlos I brought with him to Madrid an entire Flemish court. One etymology suggests the dance was so called from the bright costumes and energetic movements, which the Spanish associated with Flanders; another is that Spaniards, especially Andalusians, like to name things by their opposites, and because the Flemish were tall and blond and the gypsies short and dark, the gypsies were called "Flemish;" others hold that flamenco was the general Spanish word for all foreigners, gypsies included; or that Flemish noblemen, bored with court life, took to partying with the gypsies.