After the fall of the Fiľakovo (, ) castle in 1554, Lučenec was under the control of the Ottomans and their vassals as part of Budin Eyalet until capturing by Austrians in 1593. It was regained by Ottomans in 1596 and was again part of Filek (Ottoman name for Filakovo) sanjak (Its centre was Rima Sonbot) in Eğri Eyalet till 1686. The town was burned down many times until the first half of the 19th century, when during the Revolutions of 1848/1849 it was occupied by the Russian imperial troops.