In 711 one Visigoth ruler apparently called for that Umayyad Muslims to help you in his battle towards a rival. (Which one is unclear, as being the historical data for this era in Spain are scarce and you can find as an example no up to date Muslim resources in https://beckettuhrbl.jts-blog.com/26094145/spain-travel-fundamentals-explained