The area of Škofja Loka was in the possession of the Counts of Freising since 937. The town itself was first mentioned in 1248 as a square and gained city rights in 1274.
The town was surrounded by walls, five towers and city doors. The typical Middle Age image of the town is created the lower and upper square and the mighty Loški grad/ Loka Castle. The earthquake in 1511 partly destroyed the city and the castle, but were renovated by Count Filip. The appearance of the city has hardly changed since. A magnificent square tower used to stand in the castle courtyard. Its ground plan measures have been restored. Today the castle serves as the Loka museum.