I like that question reader Zsa Zsa, if indeed that is your real name! It’s popularly said that the Islamic occupation of the Iberian peninsula lasted for 800 years. While it may technically true in that there were Arabs on what is now Spanish soil all of that time, the Caliphate that was established there was always in flux. In fact you can make the case that Al Andalus started shrinking from virtually the moment it was established.
The invasion commenced in 711 A.D. when the first Arab conquerors crossed over at Gibraltar, having swept through all of the Middle East and North Africa over the previous 90 years. By 720 nearly the entire territory of what is now Spain and Portugal was united under a Caliphate. A capitol was set up in the southern city of Córdoba, which in relatively short order (150 years) became one of the dominant economic and cultural centers in all of Europe and the Middle East. This “golden age” didn’t last terribly long however, as infighting soon divided up the Caliphate into some 20 separate states, which fought with outsiders and one another until they eventually began to fall to Christian powers pressing in from the north.
As I mentioned the re-conquest (“Reconquista” as it’s known in Spain) of Al-Andalus started almost immediately after the Arabs took the place, as many of the local peoples — especially those up in the northwest — chafed under Muslim rule. The movement began as early as 718 but really began to pick up steam starting in about 900 A.D.. By 1150 over half of the peninsula was reclaimed, and by 1249 the only remaining region still under Muslim control was a small state all the way south near Gibraltar called the Emirate of Granada. And in fact the only reason that region survived was because it was a convenient way for the reigning powers up in Castile to extract tribute from what was left of the old Caliphate.
By the time Ferdinand and Isabella — of Christopher Columbus fame — came along, Granada was on its last legs. Spanish forces crushed it militarily the same year that the Americas were discovered, in 1492. About 200,000 Muslims remained in Spain following this final coup-de-grace and were allowed to practice their religion until 1500. In what many historian consider to be a gratuitous injustice, even the descendants of those last remaining Muslims were booted out of the country in 1609.
I hope that answers your question, dahlink!