The castle was first mentioned 1245. It was built by Béla IV of Hungary on the same spot as an earlier fortress. Later it became the manorial seat with 15 settlements. In the 16th and 17th centuries, the castle was one of the significant fortresses against the Turkish invasion of Central-Europe. It was modernised in the 17th century but got neglected in the 18th century. The castle was first part of the estate of the lordship but later was passed on through many aristocratic families.