A local tradition holds that a Master of the Order, Don Gonzalo Yánez, gave the town its charter in 1213, confirmed by Ferdinand III of Castile in 1222. In 1273, Alfonso X of Castile convoked the Castilian Cortes in Almagro and in 1285 Master of the Order Ruy Pérez Ponce worked out an agreement in 1285 over rights concerning the town's ovens, market place, and toll roads. In the fourteenth century, the town had a wall and a parish church, San Bartolomé el Real, butcher shops, granary, jailhouse, townhall, and a castle absorbed by the buildings owned by the Order of Calatrava.