In 1707 Ungvar was the residence of Ferenc II Rákóczi, leader of the national liberation war of Hungarians against Vienna.The beginning of the 19th century was characterized by economic changes, including the first factories in the city.