During the revolution in 1848-49, Pécs was occupied by Croatian armies for a short time, but it was freed from them by Habsburg armies in January 1849.
At the end of World War I, Baranya county was occupied by Serbian troops, and it was not until August 1921 that Pécs could be sure that it remains part of Hungary.