In 1789, the Spanish empire prepared to enforce their territorial claims far to the North of what they nominally controlled, and instigated a crisis that threatened to bring the great European powers to war.
The Reconquista, or Christian reconquest of Iberia, took nearly 800 years. The fighting did not come without great attempts by Muslim powers across the strait trying to reestablish their presence in mainland Europe. The last gasp of that effort came in the 1330s, when the powerful Marinid sultanate of what is modern Morocco invaded in an attempt to reverse Christian gains and secure the perilous position of the Sultanate of Granada.