The earliest documented reference to the Flamenco tradition goes back to the late eighteenth century. Its development since then has been extensively documented, but the origins of the tradition are unknown.
There is no doubt that Flamenco is rooted in various Andalusian popular musical styles, although its origins is the subject of many hypotheses which may or may not have ideological implications and none of which are necessarily mutually exclusive. The most widespread is that flamenco was developed through the cross-cultural interchange between Andalusia's morisco (formerly Muslim) peasantry and incoming gitanos during the sixteenth century specifically in South Western Andalusia (Machin-Autenrieth 2015, 29).
Source : Wikipedia
In addition, the origin of the word 'Flamenco' is itself is also unknown. (see Wikipedia)