The earliest reference to a permanent settlement in the Krefeld-Uerdingen area dates to 809: the city charter for Friemersheim describes a nearby town as "Urdingi". By the mid-thirteenth century, Uerdingen was a thriving port, serving the Rhine river trade as the northernmost exclave of the Electorate of Cologne. In 1255, Uerdingen was granted its first city charter. The town had an inside harbor and special customs office for ships traveling onwards to Cologne. The town was traded between various German noble houses during the late Middle Ages.