Whoever came up with the term Reconquista to describe the Christian conquest of the Iberian Peninsula from Muslims deserves an all-time gold star for public relations work. I mean, there were parts of modern Spain that were in Muslim hands for well over seven hundred years, and if there’s a statute of limitations on when something stops being a “reconquest” and becomes simply a “conquest,” I have to think it’s shorter than seven hundred years. When you’re talking about people living in the southern part of Iberia in the 1400s who had ancestors who were born in the mid to late 700s and never knew anything but Muslim rule, I think it’s safe to say that the Muslims got pretty entrenched there before the last Muslim kingdom was finally wiped out.
By 1340, the Muslim presence on the peninsula was down to that last Muslim kingdom: the Emirate of Granada, which was founded in 1238, after the last Muslim empire to control all of al-Andalus, the Almohad Caliphate (“Caliphate” at this point is being used pretty loosely) lost its hold on Iberia in the Battle of Las Navas de Tolosa in 1212. By that point the Reconquista was in full swing, and when Seville fell to the Castilians in 1248, Granada was the last Muslim polity standing. It managed to hold out for almost 250 more years under the Nasrid Dynasty, though it was a Castilian vassal for most of its existence.
Río Salado represents the last attempt by a Muslim empire based in North Africa to invade Iberia and restore Muslim rule there. In this case we’re talking about the Marinids, a Berber dynasty that defeated the Almohads and took control of most of modern Morocco in 1244, and then absorbed the remaining Almohad territories when that dynasty’s last ruler was assassinated in 1269. They were keenly interested in what was happening in Iberia, particularly after the Castilians crossed into Morocco a couple of times in the 1260s (the Marinids defeated them both times). So, in the 1290s they crossed into southern Iberia and captured Algeciras and Gibraltar, along the southern tip of the peninsula. They lost Gibraltar in 1309 but got it back in 1333.
Meanwhile, relations between Granada and Castile had gone south (this happened a few times over the course of their relationship), and in 1330 Alfonso XI of Castile (d. 1350) defeated Granada at the Battle of Teba. Peace between the two kingdoms was restored for a while under the Nasrid Sultan Yusuf I (d. 1354), but meanwhile the Marinid Sultan, Abu al-Hasan Ali b. Uthman (d. 1351), was building a pretty major invasion force, and was preparing to come to the aid of the Nasrids and to lead a great “reconquest” of his own to restore Muslim rule throughout al-Andalus. In 1340, the Marinid fleet sailed for Algeciras, destroying the Castilian fleet along the way, and then landed, met up with Yusuf’s Granadan forces, and besieged the fortress of Tarifa (this is sometimes referred to as the Battle of Tarifa for this reason; “Río Salado” refers to a stream that runs through the valley where most of the battle was fought).
Abu al-Hasan made what turned out to be a catastrophic mistake once he arrived at Algeciras. Assuming that the Castilian fleet was no longer a concern, he mothballed or sent back to Morocco most of his own ships. But Alfonso XI appealed to Portugal, which happened to be ruled by his father in-law Alfonso IV, for help. Alfonso IV provided a substantial fleet, which was able (in the absence of any Marinid fleet to resist it) to easily cut off the Marinids’ supply line back to Morocco, and personally led his own army to meet up with Alfonso XI and relieve the besieged Tarifa.
Abu al-Hasan realized he was in trouble when the Portuguese fleet cut off his supply line, so he ordered a costly full assault on Tarifa on October 10, which failed and badly weakened his army. When he got word of the approaching Castilian-Portuguese relief force, he raised the siege and prepared to meet it. On the night of October 29, Alfonso XI ordered a contingent of his forces to ride around the Marinid lines and enter Tarifa; Abu al-Hasan had given orders to his men to prevent something like this from happening, but the Castilians got into the fortress anyway and, to make matters worse, nobody ever seems to have let Abu al-Hasan know that it happened.
On October 30, Alfonso XI’s men faced off against Abu al-Hasan’s Marinids while Alfonso IV’s Portuguese forces fought Yusuf I’s Granadans. Jesus Christ, that’s quite a sentence. Anyway, Alfonso XI looked to be in a bit of trouble, until the forces he’d sent into Tarifa charged out of the city, routed Abu al-Hasan’s camp, and then attacked his main army from the rear. Alfonso IV had less trouble with the Granadans, and so the battle was a total Castilian-Portuguese victory. Aside from it being the last time a Muslim North African power tried to invade Iberia, the battle is noteworthy for the violence the Christians inflicted on the Muslim camp, where they’re said to have killed many of Abu al-Hasan’s wives. Both Abu al-Hasan and Yusuf made it back to Algeciras, and Abu al-Hasan continued from there to Gibraltar and on to Morocco, never to return.
The war between Castile and Granada went on for ten more years. Algeciras itself fell to the Castilians in 1344, but Gibraltar would remain in Granadan hands until 1462, despite the fact that it was cut off from the rest of Granada. Alfonso IX died while besieging it in 1350, a victim of the Black Death. Yusuf I was assassinated in 1354; he was only 36. Abu al-Hasan had more success expanding his empire in North Africa than he did in Iberia, and for a short time in the 1340s he ruled over Tlemcen (the city that controlled most of what is now northern Algeria) and Ifriqiya (roughly modern Tunisia) in addition to Morocco. But the Arab tribes under his control revolted in Tlemcen and Ifriqiya in 1348, and meanwhile his own son, Abu Inan Faris, deposed him in his capital, Fez. He was forced to abdicate in favor of Abu Inan Faris in 1350 or 1351, and died shortly thereafter.