Épernon was originally the home of the counts of Montfort and Amaury. In the 11th century, they raised the fortresses of Épernon and Montfort for the protection of the Château de St Léger and granted a charter to the town. Four gates gave access to the medieval city: the gate of Chartres, the gate of Geolle, the gate of Paris and the gate of Beauce. Above the gates an inscription paid homage to the village that previously existed there: "Autrist fut jadis mon nom/A présent on me nomme Espierremont" (Autrist was once my name/now my name is Espierremont). Charters of the 12th and 13th century variously refer to the town as Sparno and Sparnonum, but by the 14th century it had evolved to Esparnon and Espernon, very close to its present appellation.