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:Celje Castle was once the largest fortification on Slovenian territory. The first fortified building on the site (a Romanesque palace) was built in the first half of the 13th century by the Counts of Heunburg from Carinthia on the stony outcrop on the western side of the ridge where the castle stands. It had five sides, or four plus the southern side, which was a natural defence. The first written records of the castle date back to between 1125 and 1137; it was probably built by Count Gunter. In the western section of the castle, there was a building with several floors. Remains of the walls of this palatium have survived. In the eastern section, there was an enclosed courtyard with large water reservoirs. The eastern wall, which protects the castle from its most exposed side, was around three metres thicker than the rest of the curtain wall. The wall was topped with a parapet and protected walkway.