Since the 14th century, escaping from the Ottoman threat, a large number of Serbs migrated to the Kingdom of Hungary where many of them served as soldiers. After the Battle of Mohács in 1526, much of the territory of present-day Hungary came under Ottoman administration. During Ottoman administration towns in the territory of present-day Hungary began decaying and the former Hungarian and German population left them. In that time, especially in the 17th century, many Serb, and other Southern Slavic migrants settled in the territory of present-day Hungary. It is interesting that most of the Ottoman soldiers in the territory of present-day Hungary were South Slavs (mostly Serbs and Bosnian muslims).