The castle was built in 1328 at the command of King Alfonso XI, the Just. It was built in the gardens of the Arab fortress.