Kežmarok is situated in the valley below the High Tatras and Spišská Magura Mountains at the crossroads of long-distance trade routes. The site has been inhabited since prehistoric times and by the 9th and 10th centuries there were several settlements on its territory.
The oldest written mention dates to 1251 and refers to the Saxon settlement near the Church of St Elisabeth. Saxons were granted privileges in 1269, guaranteeing the right of free market, self-government and many freedoms. The settlement originated through the merger of Slovak settlements with the German one. Traces of this genesis may be seen in the triangular ground plan of the historic core. The trade heart of the town, the old market, was situated along the long-distance road, today’s MU Dr Alexander street. The new market was founded further south, on the site of today´s town hall, in the 14th century. Kežmarok was granted free royal town privileges in 1380.
The Parish Church of the Holy Cross was constructed amidst the built-up area in the second half of the 14th century on the site of an older chapel. The church obtained its characteristic three-nave hall space in the 15th century and has been preserved right up to the present day. The church belfry with its gable attic and graffito decorations was added in 1586-1591. By the late 14th century the town was encircled by continuous walls with three original gates. The 15th century was a period of economic prosperity which was clearly reflected in its building activities. Stone Gothic and Renaissance passageway burgher houses were built in rows. After the Gothic Town Hall was damaged by fire in 1515 a Renaissance building was constructed on the same site in the second half of the16th century and a slender tower was added to it in 1641.
Kežmarok Castle was constructed as a defensive castle shortly before 1463, when it is first mentioned in connection with the Hungarian Zapolsky family, following which it changed hands several times. It was acquired in 1577 by the Thokoly family which had the existing Gothic fortress rebuilt as a luxurious Rennaisance residence. The castle chapel was built during the later Neo-Baroque reconstruction in 1658. Dramatic events after the suppression of the rebellion led by Imrich Thokoly against Emperor Ferdinand I suddenly brought building activities at the castle to a close. In 1720 the town became the owner of the castle, ridding themselves of the landlord’s rule. However, from this point onwards the castle area gradually deteriorated. The town pulled down part of the walls on the west side of the castle and barracks were built in its place. The historical exhibition of Kežmarok Museum was opened here following a step-by-step reconstruction.
The most important buildings of the 18th century originated in then Kežmarok´s suburbs. One of the most important of these is the Baroque wooden articulated Protestant church from 1688. After its reconstruction at the beginning of the 18th century only the stone part of the sacristy was preserved. Next to the church stands the Lutheran Lyceum, built in 1775 and later extended several times. A valuable part of the Lyceum is the largest historical school library in Central Europe which is open to public and contains 150,000 volumes. The Lyceum taught many famous personalities and national awakeners.
The two-storey monumental Reduta building was constructed in the town centre at the beginning of the 19th century. Another important dominant feature of the town, the Protestant Church in Neo-Byzantine style, was built at the end of the 19th century. It houses the burial chapel of Imrich Thokoly. The railway line between Poprad and Kežmarok was opened at the end of the 19th century. The interesting railway station building in Art Nouveau style was constructed on the site of the former St Michal settlement.
The historic core of Kežmarok was declared a Town Conservation Reservation in 1950.