The town and the castle of Loket are situated on a substantial Tertiary granite massif, the impenetrability of which forced the Ohře River to change its direction and to bypass the massif from three sides.
The river thus created the characteristic loop and gave the castle and the town beyond the castle walls their name in Czech, German, as well as in Latin, i.e. Loket (German: Elbogen, Latin: Cubitum, English: Elbow).
The anticipated existence of a prehistoric settlement and the later Slavic hill fort on the vast and strategically advantageous rock massif have not been supported by archaeological finds even if the discovery of hill-fort pottery and the spike from a Carolingian-type lance suggest the presence of Slavs in Loket as early as the 9th century.
However, considering the terrain configuration, we should obviously look for an older settlement in the area of the medieval town rather than on the rugged rock outcrop, extended and cultivated only by the construction of a Romanesque castle.
The oldest development of the castle has always been the subject of dispute. The Romanesque rotunda is usually considered as the oldest preserved structure on the present-day castle grounds. It was discovered in the structure of the northern palace in 1966. The round rotunda with an apse on its east side is built from granite blocks. It was built in the third quarter of the 12th century during the reign of King Vladislav II (also denoted as Vladislaus II of Bohemia, 1140-1173). However, its relation to the later castle architecture remains unknown. The presumption that it may have served as the only stone structure of an older Slavic hill fort cannot be ruled out.
Following archaeological research carried out in the past decades (bailey, tower wing, hetman's house, eastern palace, northern palace, eastern bastion wing, and margrave's house) by the Monument Institute in Plzeň (Eva Kamenická) and the Karlovy Vary Museum (Jiří Klsák) and complemented with historical construction-related research, two initial development phases of the castle were ascertained.
The older bergfrit layout of the ministerial castle from the period of the reign of Friedrich Barbarossa with the keep on the summit of the rock outcrop, which dominates the castle to this day, the margrave's house serving as a palace, and a Romanesque chapel, which is currently a part of the Church of St. Wenceslas – this appearance of the castle was the work of a building lodge, possibly from Cheb, in the period of German colonization of the upper Ohře River area. The royal Bohemian castle with peripheral buildings was built at the turn of the 12th and 13th century, perhaps during the reign of King Přemysl Otakar I (also denoted as Ottokar I of Bohemia, 1197–1230) or his successor, King Václav I (also denoted as Wenceslas I of Bohemia, 1230–1253). This is supported by Romanesque elements which were gradually uncovered within the framework of the research work carried out in the individual castle buildings.
In addition to the boss ashlar masonry discovered in the tower and the northern palace, Romanesque foundations were also uncovered in the margrave's house. A Romanesque wall was discovered in the tower wing, the hetman's house, and in the eastern palace. The Romanesque wall was reinforced by peels that have been partly preserved to our time. The walls enclosing the rotunda are believed to belong to the Late Romanesque period. The rotunda retained the function of a castle chapel (capella castri) until the 15th century.
Beyond the walls of the castle guarding the trading trail along the Ohře River and the land borders before Egerland (the German name for the area of Cheb) finally became a part of the Bohemian state in 1322, a fortified royal town was founded at the turn of the 12th and the 13th century. The town, originally a part of the Sedlec district, became the centre of the of the Loket district around 1230. However, the town is unambiguously documented in written records in 1234.
The administration of the castle and the region was executed on behalf of the king by the castle burgrave and later by the hetman. At the same time, a unique feudal (vassal) system was created which remained in effect up to the 17th century.
The king's vassals from among the local minor nobility performed military service for the king, in return for which they enjoyed greater privileges than in other Lands of the Bohemian Crown. As regards legal matters, they were subject to the vassal court, which convened at Loket Castle and was chaired by the land magistrate selected from among the Loket vassals.