The palace was primarily built between the 13th and 14th centuries by the Moorish Nasrid Dynasty (though small parts of it were initially constructed in the ninth century by the previous dynasty ...