The Muslims thus regained a major city which had been in Castilian hands since Alfonso XI of Castile took it from the Moroccans after the long 1342–1344 siege.
It was impossible to defend the place at a time when the Muslim kings of the Iberian Peninsula had lost much of military power they enjoyed in earlier centuries.
The end of the Spanish civil war after Peter died in 1369 convinced the Granadans of the need to secure their borders with Castile and regain control of the Strait of Gibraltar.
[citation needed] The rushed rebuilding left much to be desired compared to the original fabric of the thirteenth century Moorish defenses.
Thus the main gate of the city, the Puerta del Fonsario, which had suffered most of the attacks by trebuchets during the siege of Alfonso XI, was rebuilt in part with a weak wall of mortar.
[citation needed] The combination of decreased physical defenses and a small garrison for the town after movement of troops to the north caused the Muslim siege to be devastating for the city.
[6] The terror caused by the fall of the southern town and the conviction that no reinforcements would arrive from Castile forced the decision to deliver the besieged city before suffering more casualties.
The mayor of the Villa Vieja, Alonso Fernández Portocarrero, third Lord of Moguer,[7] asked the king of Granada to grant safe conduct to the inhabitants to leave the city with their most valuable possessions.
The Cathedral of Algeciras, the former Mosque, was returned to Islamic worship, and the king of Granada occupied the ancient fortress located in the Cerro de Matagorda.
The Kingdom of Granada was no longer an important military or economic power in the peninsula, so the main value of Algeciras as a port for entry of North African troops and trade was diminished.