The name of the town was first mentioned as "Keykkw" (Hungarian: "Kékkő") in 1290. The name of the settlement means "Blue rock". Ruins of the castle Modrý Kameň stand on a rock pinnacle above the town. The castle was built in the second half of the 13th century by the ancestors of the Balassa noble family. They had to recapture the castle from sons of Casimir of the Hunt-Poznan clan by a siege in 1290. The castle was captured by Ottoman troops in 1576, because its guard fled when they heard the approaching Ottomans. The castle was given up and subsequently destroyed by Ottoman troops in 1593. It was restored between 1609 and 1612 by Sigismund Balassa. The castle was ravaged many times during the 17th century, so it became ruined and abandoned. The Balassa family built a new Baroque mansion house on the side of castle hill in the early 18th century; stones of the former castle were used in the mansion building operations. The last member of the Balassa noble family died in 1899. After the demise of the Balassa family, the Almásy noble family became the proprietors of castle Modrý Kameň. They sold the demesne to the Czechoslovakian state in 1923.