not regarded as a particularly hospitable place to live. In 1315 the Nasrid Moors of Granada attempted to recapture Gibraltar but abandoned a brief siege when a Castilian relief force appeared. Eighteen years later, the Nasrid Sultan of Granada, Muhammed and the Marinid Sultan of Fez, Abu al-Hasan Ali ibn Othman, united to besiege Gibraltar with a large army and naval force. This time the king of Castile, Alfonso XI, was unable to raise a relief force for several months because of the threat of rebellions within his kingdom. The relief force eventually arrived in June 1333 but found that the starving inhabitants of Gibraltar had already surrendered to the Moors of Fez. The Castilians now found themselves having to besiege an entrenched enemy, but they were unable to break through the Moorish defences and, faced with a stalemate, the two sides agreed to disengage in exchange for mutual concessions and a four-year truce. Abu al-Hasan refortified Gibraltar with what the Arab chroniclers called "strong walls as a halo surrounds a crescent moon" in anticipation of renewed war, which duly broke out in 1339. However, his forces suffered a disastrous defeat at the Battle of Río Salado in October 1340 and fell back to Algeciras. The Castilians besieged the city for two years and eventually forced its surrender, though Gibraltar remained in Moorish hands. The peninsula's defences had been greatly improved by Abu al-Hasan's construction of new walls, towers, magazines and a citadel, making its capture a much more difficult endeavour. Alfonso XI once again laid siege in 1349 following the death of Abu al-Hasan but was thwarted by the arrival of the Black Death in 1350, which killed many of his soldiers and claimed his own life. Gibraltar remained in Moorish hands until 1462 but was disputed between the Nasrids of Granada and Marinids of Fez. In 1374 the latter handed the peninsula to the former, apparently in payment for Granadan military support in suppressing rebellions in Morocco. Gibraltar's garrison rebelled against the Nasrids in 1410 but a Granadan army retook the place the following year after a brief siege. Gibraltar was subsequently used by the Granadans as the base for raids into Christian territory, prompting Enrique de Guzmán, second Count of Niebla, to lay siege in 1436. The attempt ended in disaster; the attack was repelled with heavy casualties and Enrique himself was drowned while trying to escape