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.