At the beginning of the 13th century, Loket, a royal castle was built on a landmark promontory within the Ohře River bend.
It used to be called the "Key to the Czech Kingdom". Soon after, a small town, first mentioned in 1288, arose below the castle.
In the early 15th century the royal town was fortified and turned into an important focal point of the Czech Crown.