The correct answer is the third one: At one point, Spain was part of the Islamic world.
Spain was under Islamic rule between 711 AD and 1492 AD, year in which the last Islamic Kingdom of Granada was expelled by the Catholic Kings. The Iberian peninsula was conquered in 711 and integrated as a province of the Omayyad Caliphate. During all this period, Islamic culture flourished in Spain with great achievements in art, architecture, music, literature, philosophy, and other fields.