At the time of the Rákóczi war of independence (1703–1711), the town was under the control of Count Miklós Bercsényi. The royal court confiscated the estate and gave it to imperial general Leopold Schlick. During the war of independence, Miklós Bercsényi seized the town back and gave it to the Kuruts general Sándor Károlyi for leasehold. The royal court in Vienna did not accept Károlyi's claim to the territory after the peace of Szatmár and he was only able to retrieve it by buying it back years later. From 1722 to 1818, when landowner jurisdiction was abolished, the Károlyi family possessed the town.