The city of Tetouan had just suffered major destructions in separate occasions during the 15th century. In 1399, Castilians burned down the city and enslaved its population in retaliation for piracy activities. An attack by the Portuguese, who had already captured Ceuta to the north, followed in 1436.