781 years of Islamic occupation from the Islamic conquest of the Iberian Peninsula which commenced in 711 AD to the fall of Granada in 1492.
In 722, the Christians had their first victory against the Muslims. A Christian force was pushed deep into the mountains. A few hundred men moved into a narrow valley at Covadonga. There, they could defend against a broad frontal attack. The Christain forces routed the Muslim army, inspiring local villagers to take up arms.
The invasion of Europe from the Southwest was halted by Charles Martel leading the Frankish army against the Muslims defeating them at the Battle of Tours in 732.
Charlemagne organized a regional sub-kingdom in order to secure the southern border of the Carolingian Empire against Muslim incursions.
Ferdinand and Isabella completed the Reconquista with a war against the Emirate of Granada that started in 1482 and ended with Granada's complete annexation in early 1492.