The town underwent modernization in the 19th and 20th centuries, for example, new industries like brickworks or tanneries were built, telegraph line in 1865, and in 1871 it was connected to the railway connecting Budapest () and Žilina (, ). After World War I, Lučenec became part of Czechoslovakia, and, briefly in 1919, part of the Slovak Soviet Republic. In 1938, Lučenec was annexed to Hungary as a result of the First Vienna Award, and this lasted until 1945 when it was returned to Czechoslovakia.