Abu al-Hajjaj Yusuf ibn Ismail (29 June 1318 – 19 October 1354), known by the regnal name al-Muayyad billah (lit. 'He who is aided by God'), was the seventh Nasrid ruler of the Emirate of Granada on the Iberian Peninsula. The third son of Ismail I (r. 1314–1322), he was Sultan between 1333 and 1354, after his brother Muhammad IV (r. 1325–1333) was assassinated.
Coming to the throne at age fifteen, he was initially treated as a minor and given only limited power by his ministers and his grandmother Fatima. In February 1334, his representatives secured a four-year peace treaty with Granada's neighbours Castile and the Marinid Sultanate. Aragon joined in the treaty in May. After gaining more control of the government, in 1338 or 1340 he expelled the Banu Abi al-Ula family, who had masterminded the murder of his brother and had been the leaders of the Volunteers of the Faith—North African soldiers who fought for Granada. After the treaty expired, he allied himself with Abu al-Hasan Ali (r. 1331–1348) of the Marinids against Alfonso XI of Castile (r. 1312–1350). After winning a major naval victory in April 1340, the Marinid–Granadan alliance was decisively defeated on 30 October in the disastrous Battle of Río Salado. In its aftermath, Yusuf was unable to prevent Castile from taking several Granadan castles and towns, including Alcalá de Benzaide, Locubín, Priego and Benamejí. In 1342–1344, Alfonso XI besieged the strategic port of Algeciras. Yusuf led his troops in diversionary raids into Castilian territory, and later engaged the besieging army, but the city fell in March 1344. A ten-year peace treaty with Castile followed.
In 1349, Alfonso XI broke the treaty and invaded again, laying siege to Gibraltar. Yusuf was responsible for supplying the besieged port, and led counter-attacks into Castile. The siege was lifted when Alfonso XI died of the Black Death in March 1350. Out of respect, Yusuf ordered his commanders to not attack the Castilian army as they retreated from Granadan territories carrying their king's body. Yusuf signed a treaty with Alfonso's son and successor Peter I (r. 1350–1366), even sending his troops to suppress a domestic rebellion against the Castilian king, as required by the treaty. His relation with the Marinids deteriorated when he provided refuge for the rebellious brothers of Sultan Abu Inan Faris (r. 1348–1358). He was assassinated by a madman while praying in the Great Mosque of Granada, on the day of Eid al-Fitr, 19 October 1354.
In contrast to the military and territorial losses suffered during his reign, the emirate flourished in the fields of literature, architecture, medicine and the law. Among other new buildings, he constructed the Madrasa Yusufiyya inside the city of Granada, as well as the Tower of Justice and various additions to the Comares Palace of the Alhambra. Major cultural figures served in his court, including the hajib Abu Nu'aym Ridwan, as well as the poet Ibn al-Jayyab and the polymath Ibn al-Khatib, who consecutively served as his viziers. Modern historians consider his reign, and that of his son Muhammad V (r. 1354–1359, 1362–1391), as the golden era of the Emirate.
Abu al-Hajjaj Yusuf ibn Ismail was born on 29 June 1318 (28 Rabi al-Thani 718 AH) in the Alhambra, the fortified royal palace complex of the Nasrid dynasty of the Emirate of Granada. He was the third son of the reigning sultan, Ismail I, and a younger brother of the future Muhammad IV. Ismail had four sons and two daughters, but Yusuf was the only child of his mother, Bahar. She was an umm walad (freed concubine) originally from the Christian lands, described as "noble in good deeds, chastity and equanimity" by Yusuf's vizier, the historian Ibn al-Khatib. When Ismail was assassinated in 1325, he was succeeded by the ten-year old Muhammad, who ruled until he too was assassinated in 25 August 1333, when he was en route back to Granada after repulsing a Castilian siege of Gibraltar, jointly with the Marinids of Morocco.
Ibn al-Khatib described the young Yusuf as "dark skinned, naturally strong, had a fine figure and an even finer character", with large eyes, dark straight hair and a thick beard. He further wrote that Yusuf liked to "dress with elegance", was interested in art and architecture, was a "collector of arms", and "had some mechanical ability". Before his accession, Yusuf lived in his mother's house.
Founded by Muhammad I in the 1230s, the Emirate of Granada was the last Muslim state on the Iberian Peninsula. Through a combination of diplomatic and military manoeuvres, the emirate succeeded in maintaining its independence, despite being located between two larger neighbours: the Christian Crown of Castile to the north and the Muslim Marinid Sultanate across the sea in Morocco. Granada intermittently entered into alliance or went to war with both of these powers, or encouraged them to fight one another, in order to avoid being dominated by either. From time to time, the sultans of Granada swore fealty and paid tribute to the kings of Castile, an important source of income for Castile. From Castile's point of view, Granada was a royal vassal, while Muslim sources never described the relationship as such. Muhammad I, for instance, on occasion declared his fealty to other Muslim sovereigns.
Yusuf's predecessor, Muhammad IV, sought help from the Marinid Sultanate to counter a threat by an alliance of Castile and the powerful Granadan commander Uthman ibn Abi al-Ula, who supported a pretender to the throne in a civil war. In exchange for the Marinid alliance, he had to yield Ronda, Marbella and Algeciras. Subsequently, the Marinid–Granadan forces captured Gibraltar and fended off a Castilian attempt to retake it, before signing a peace treaty with Alfonso XI of Castile and Abu al-Hasan Ali of the Marinids the day before Muhammad IV's assassination. While the actual killing of Muhammad IV was carried out by a slave named Zayyan, the instigators were Muhammad's own commanders, Abu Thabit ibn Uthman and Ibrahim ibn Uthman. They were the sons of Uthman ibn Abi al-Ula, who died in 1330, and his successors as the leaders of the Volunteers of the Faith, the corps of North Africans fighting on the Iberian Peninsula for Granada. According to Ibn Khaldun, the two brothers decided to kill Yusuf due to his closeness to the Marinid Sultan Abu al-Hasan—their political enemy—while according to Castilian chronicles it was because of the friendly way he treated Alfonso XI at the conclusion of the siege.
As a result of Muhammad's cessions to the Marinids and the taking of Gibraltar, the Marinids had sizeable garrisons and territories on traditionally Granadan lands in Al-Andalus (the Muslim-controlled part of the Iberian Peninsula). Their control of Algeciras and Gibraltar—two ports of the Strait of Gibraltar—gave them ability to move troops easily between North Africa and the Iberian Peninsula. The control of these ports and the waters surrounding them was also an important objective for Alfonso XI, who wanted to halt the North African intervention in the peninsula.
The Nasrid dynasty of Granada had no specific rule of succession, and the sources are silent as to why Yusuf was chosen over Ismail's second son Faraj, who was a year older. There are differing reports of where Yusuf was proclaimed and who selected him. According to the historians L. P. Harvey and Brian Catlos, who follow the report of the Castilian chronicles, the hajib (chamberlain) Abu Nu'aym Ridwan, who was present at Muhammad IV's assassination, rode quickly to the capital Granada, arriving on the same day and, after consultation with Fatima bint al-Ahmar (Ismail's mother, and grandmother of Muhammad and Yusuf), arranged for the declaration of Yusuf as the new sultan. The proclamation took place the next day, 26 August (14 Dhu al-Hijja 733 AH). Another modern historian, Francisco Vidal Castro, writes that the declaration and the oath of allegiance took place in the Muslim camp near Gibraltar instead of in the capital, and that the instigators of the assassination, the Banu Abi al-Ula brothers, were the ones who proclaimed him.