Originally the 13th-century fortress of Naples ' French ruler Charles d 'Anjou , it was rebuilt in the 15th century as a palace for the Spanish kings of Aragon .
In Naples , the 13th-century fortress was under French rule but it was built again in the 15th century as a palace for Spanish rulers .