Representatives of the Cordoba Caliphate resided there. At that time it was called Al-Muwarak. The complex consists of several parts built in different periods.