The city has a long history. In it, the Pedro IV of Aragon and Enrique II of Castilla signed the truce between Castillla and Aragon. Juan Hurtado de Mendoza was the majordomo of king Enrique III. The king Enrique IV of Castilla gave the city to him. He also got to supervise the city. Later the duchy was divided into two different parts.