The first written record of the Fiľakovo town and the Castle is from 1242, where the castle withstood the Mongol invasions. In 1423 the town received municipal privileges. In 1553 the town with castle fell to the Turks and was seat of a sanjak (an administrative division of the Ottoman Empire) until 1593, when it was reconquered by the Imperial troops. However, it fell once more to the Turks in 1662 and the town along with the castle was burned down in 1682 by troops of Imre Thököly. It was finally passed to Austrians in 1686. After the Treaty of Trianon in 1920 came under the rule of Czechoslovakia. It belonged to Hungary again in years 1938–1945 after the First Vienna Award.
References:The first written record of church in Danmark locality date back to the year 1291. Close to the church are several stones with a Christian text and cross inscribed. The oldest parts of the present red-brick church are from the 1300s. In the late 1400s the church was enlarged to the appearance it has today. The church has been modified both internally and externally several times, among other things after the fires in 1699 and 1889. There are lot of well-preserved mural paintings in the walls.