Abu Malik Abd al-Wahid's role in Al Andalus began in 1332 when the newly crowned Abu al-Hasan responded to an appeal from
Muhammed IV, the
Nasrid Sultan of Granada, for assistance against Castile by sending his son and an army to help the Granadans. During 1332, Abu Malik oversaw the transportation of a force of some 7,000 men from Morocco to Algeciras. They marched on the Castilian-held fortified town of Gibraltar the following February and took it in the
Third Siege of Gibraltar, which lasted nearly five months. A Castilian army under King
Alfonso XI arrived too late to save the garrison but mounted the
Fourth Siege of Gibraltar between June and August 1333 in an effort to regain it. Although the Castilians inflicted a significant defeat on Abu Malik's forces, killing around 500 men during a failed attempt by the Moors to ambush the Castilian army in the
Sierra Carbonera north of Gibraltar, neither side was strong enough to prevail. The Castilians had to withdraw due to political problems at home and resupply difficulties, leaving Abu Malik's forces in continued control of Gibraltar. Abu Malik, who by now called himself King of
Ronda and Algeciras agreed a four-year truce with Alfonso as part of the peace agreement that ended the siege. It did not go into effect as Muhammed IV, who was also a party to the agreement, was assassinated the day after signing it by two Granadan nobles who feared that he had converted to Christianity. Abu Malik resumed hostilities against Castile, aided by the new
Nasrid Sultan,
Yusuf I. It might have developed into a wider war backed by Abu Malik's father Abu al-Hasan, but any intentions to expand the campaign had to be abandoned when the
Zayyanid kingdom of Tlemcen (now part of
Algeria) revolted against Moroccan rule. Abu Malik, Hassan, Yusuf I and Alfonso XI reached a fresh truce agreement in 1334 and Abu Malik was recalled to Morocco to aid his father against Tlemcen. ==Invasion of Castile and death==