Gibraltar , with
Ceuta in the southeast opposite
Algeciras Bay and
Gibraltar. In 1309, Castillian troops under
Ferdinand IV captured Gibraltar, then known as the
Medinat al-Fath (City of Victory), from the Muslim-ruled
Emirate of Granada. In 1333, responding to the appeal of
Nasrid ruler
Muhammad IV of
Granada, Abu al-Hasan sent a Moroccan army to
Algeciras under the command of his son
Abd al-Malik Abd al-Wahid. A force of 7,000 men was transported across the
Strait of Gibraltar to rendezvous with the forces of
Muhammad IV of Granada at
Algeciras in February 1333. The Castilians were distracted by the coronation of King
Alfonso XI and were slow to respond to the invasion force, which was able to lay
siege to Gibraltar before much of a response could be organised. The situation in Gibraltar was desperate by mid-June. The food had run out and the townspeople and garrison had been reduced to eating their own shields, belts and shoes in an attempt to gain sustenance from the leather from which they were made. On 17 June 1333, Vasco Perez surrendered Gibraltar after agreeing terms with Abd al-Malik. The defenders were allowed to leave with honour as a mark of respect for their courage in defending the town for so long. The fall of Gibraltar was rapturously received back in Morocco; the Moorish chronicler
Ibn Marzuq recorded that while he was studying in
Tlemcen, his teacher announced to his class: "Rejoice, community of the faithful, because God has had the goodness to restore Gibraltar to us!" According to Ibn Marzuq, the jubilant students burst out into cries of praise, gave thanks and shed tears of joy. The success of the Gibraltar campaign stoked fears in the Granadan court that the Marinids would become too influential, and provoked the assassination of Muhammad IV by resentful Granadan nobles only a few months later. However, Abu al-Hasan was not ready to invade the Iberian peninsula since he was engaged in hostilities with Tlemcen. Muhammad IV's brother and successor,
Yusuf I of
Granada maintained the alliance with the Marinid ruler. A peace treaty was signed at Fes on 26 February 1334 between Castile, Granada and Morocco with a four-year duration.
Tlemcen The ruler of Tlemcen, Ibn Tashufin (r. 1318–1337), initiated hostilities against Ifriqiya, besieged
Béjaïa, and sent an army into Tunisia that defeated the Hafsid king
Abu Yahya Abu Bakr II, who fled to
Constantine while the
Zayyanids occupied
Tunis. Abu al-Hasan was married to a Hafsid princess, and in 1334 the Hafsids appealed to him for help, giving him a welcome excuse for invading his neighbour. In early 1335, Marinid forces under Abu al-Hasan invaded Tlemcen from the west and dispatched a naval force to assist the Hafsids from the east. The
Zayyanids were rolled back into the city of
Tlemcen. The Marinid sultan Abu al-Hasan started a lengthy siege of Tlemcen, turning his siege camp into a veritable adjoining city. In 1336 or 1337, Abu al-Hasan suspended the siege of Tlemcen to campaign in southern Morocco, where his troublesome brother, Abu Ali, who ruled an appanage at
Sijilmassa, was threatening to divide the Marinid dominions. In May 1337, after a two-year siege, Tlemcen finally fell to a Marinid assault. Ibn Tashufin died during the fighting. His brothers were captured and killed and the
Sultanate of Tlemcen (covering roughly modern western half of Algeria) was annexed by the Marinids. Abu al-Hasan received delegates from Egypt, Granada, Tunis and Mali congratulating him on his victory, by which he had gained complete control of the trans-Saharan trade.
Tarifa Flush from these victories, in 1339, Abu al-Hasan received an appeal from the
Nasrid ruler
Yusuf I of
Granada to help drive back the
Castilians. The assembly of a large Marinid invasion force in Morocco prompted the Castilian king
Alfonso XI to bring to an end his quarrel with
Afonso IV of Portugal. In April 1340, a Castilian fleet of some 32 galleys under admiral
Alonso Jofré Tenorio set out against the Marinid invasion fleet being outfitted at
Ceuta. The Marinid fleet, under the command of Muhammad ibn Ali al-Azafi, destroyed the Castilian fleet in the naval battle of
Gibraltar on 5 April 1340. The Castilian admiral Tenorio was killed during the engagement and only five Castilian galleys managed to make it safely out. With the sea now clear for an invasion, Abu al-Hasan spent the rest of the summer calmly ferrying his troops and supplies across the straits to
Algeciras. Abu al-Hasan crossed with the bulk of the Marinid forces in August 1340. The Marinid invasion force joined up with Granadan forces under
Yusuf I in September, and together proceeded to lay siege to
Tarifa. A desperate
Alfonso XI appealed to his father-in-law, the Portuguese king
Afonso IV for assistance. In October 1340, a Portuguese fleet under
Manuel Pessanha, supplemented by a leased Genoese fleet, managed to move into position off Tarifa and cut off the besiegers' supply line to Morocco. In the meantime,
Afonso IV of Portugal led an army overland to join
Alfonso XI of Castile near
Seville, and together they moved against the besiegers at Tarifa. The Marinid-Nasrid forces were defeated at the
Battle of Río Salado in October 1340, and Abu al-Hasan was forced to retreat back to Algeciras. After this defeat, Al-Hasan ended his campaigns in the
Iberian Peninsula. A few years later, Alfonso XI of Castile had little difficulty taking
Algeciras in March 1344.
Ifriqiya In 1346 the Hafsid Sultan, Abu Bakr, died and a dispute over the succession ensued. Several Ifriqiyan parties appealed to the Marinid ruler for assistance. In a campaign in early 1347, Abu al-Hasan's Moroccan army swept through Ifriqiya and entered
Tunis in September 1347. By uniting Morocco, Tlemcen and Ifriqiya, the Marinid ruler Abu al-Hasan effectively accomplished the conquest of dominions as great as the
Almohad empire of the
Maghreb, and the comparison was not lost on contemporaries. ==Revolt and death==