The key symbolizes the freedom of the recipient to enter and leave the city at will, as a trusted friend of city residents. The actual 'Key to the City' would function to open the city gates. ... The presentation of a Key to the City can be traced back to medieval times, when cities were enclosed by walls and locked gates.