elected ruling prince of Transylvania, and Ilona Zrínyi, in 1676. His father died when Rákóczi was a mere baby, and his mother married Imre Thököly in 1682. After Thököly was defeated, Zrínyi held the castle of Munkács (today Mukacheve in Ukraine) for three years but was eventually forced to surrender. After the Treaty of Karlowitz, when his stepfather and mother were sent into exile, Rákóczi had stay in Vienna under Habsburg supervision. Remnants of Thököly's peasant army started a new uprising in the Hegyalja region of northeastern present-day Hungary, which was part of the property of the Rákóczi family. They captured the castles of Tokaj, Sárospatak and Sátoraljaújhely, and asked Rákóczi to become their leader, but he was not eager to head what appeared to be a minor peasant rebellion. He quickly returned to Vienna, where he tried his best to clear his name. Rákóczi then befriended Count Miklós Bercsényi, whose property at Ungvár (today Ужгород (Uzhhorod), in Ukraine), lay next to his own. Bercsényi was a highly educated man, the third richest man in the kingdom (after Rákóczi and Simon Forgách), and was related to most of the Hungarian aristocracy. Fight for independence As the House of Habsburg was on the verge of dying out, France was looking for allies in its fight against Austrian hegemony. Consequently, they established contact with Rákóczi and promised support if he took up the cause of Hungarian independence. An Austrian spy seized this correspondence and brought it to the attention of the Emperor. As a direct result of this, Rákóczi was arrested on 18 April 1700 and imprisoned in the fortress of Wiener Neustadt (south of Vienna). It became obvious during the preliminary hearings that, just as in the case of his grandfather Péter Zrínyi, the only possible sentence for Francis was death. With the aid of his pregnant wife Amelia and the prison commander, Rákóczi managed to escape and flee to Poland. Here he met with Bercsényi again, and together they resumed contact with the French court. Three years later, the War of the Spanish Succession caused a large part of the Austrian forces in the Kingdom of Hungary to temporarily leave the country. Taking advantage of the situation, kuruc forces began a new uprising in Munkács, and Rákóczi was asked to head it. He decided to invest his energies in a war of national liberation, and accepted the request. On 15