George II Rákóczi, was a Hungarian nobleman, Prince of Transylvania, the eldest son of George I and Zsuzsanna Lorántffy. Born in Sárospatak, Hungary, he was elected Prince of Transylvania during his father's lifetime. On 3 February 1643, he married Sophia Báthory, who was required by his mother to convert from Roman Catholic to Calvinism. Their son was Francis I Rákóczi. On ascending the throne, his first thought was to realize his father's ambitions in Poland. With this object in view, he allied himself, in the beginning of 1649, with the Cossack hetmanBohdan Khmelnytsky, and the hospodars of Moldavia and Wallachia,, but took no action for several years. On 6 December 1656, by the Treaty of Radnot, he also allied with King Charles X Gustav of Sweden against King John II Casimir of Poland. Rákóczi was to seize the provinces of Lesser Poland and Mazovia, together with rich salt deposits in Wieliczka and Bochnia. In 1657, he invaded the Polish-Lithuanian Commonwealth in the third part of the Second Northern War, also known as The Deluge. In late January 1657, Rákóczi's army of some 25,000 crossed the Carpathians near Krosno. The Transylvanians headed towards Medyka, where they were joined by some 10,000 Zaporozhian Cossacks under Anton Zdanovich. The Transylvanian-Cossack army approached Lwow, but failed to capture the fortified city. Then it headed westwards, to Kraków. The march of the army was marked by numerous atrocities, destruction, and looting. Rákóczi captured and destroyed Dukla, Lesko, and Sanok, but failed to seize Przemyśl, Krosno, and Łańcut. On 21 March 1657, Rákóczi entered Tarnów, and seven days later reached Kraków, which had already been under Swedish control. The Swedish garrison of Kraków was reinforced by 2,500 Transylvanians under János Bethlen, while Rákóczi headed northwards. On 12 April, near Ćmielów, the Transylvanians joined the Swedish army under Charles X Gustav. The combined forces crossed the Vistula at Zawichost, on 19 April capturing Lublin. On 8 May the Swedish-Transylvanian army besieged Brzesc nad Bugiem, capturing it two days later. After the siege, Rákóczi's soldiers busied themselves with plundering and looting. Among others, the Transylvanians burned Biała Podlaska and Brańsk. On 20 May, news of the Dano-Swedish War reached Charles X Gustav and the king decided to march towards Swedish Pomerania, leaving Gustaf Otto Stenbock in charge. The army then marched towards Warsaw, burning the towns of Mielnik, Drohiczyn, Nur, Brok, and Pniewo. On 17 June, after a three-day siege, Rákóczi and Stenbock captured Warsaw. Swedish forces remained in Warsaw only for a few days, as on 22 June they left the city, marching to Szczecin, to join the war against Denmark. Since Rákóczi was well aware of the real quality of his army, he decided to abandon Warsaw as well, and head southeast. Following an order of Polish King John II Casimir Vasa, the Transylvanians were followed by a 10,000 strong mounted army of Stefan Czarniecki, supported by Lithuanians of and Austrian allies of Poland. At the same time, forces of Jerzy Lubomirski organized a revenge invasion of Transylvania, with widespread looting and destruction of Rákóczi's realm. On 8 July 1657 in Lancut, Polish leaders decided to split their forces. Stefan Czarniecki was to follow Rákóczi, while Jerzy Lubomirski and Stanisław "Rewera" Potocki were to cut the Transylvanians and Cossacks from crossing the border and escaping Poland. On 11 July Czarniecki partly destroyed the Transylvanian army in the Battle of Magierów. On 16 July, the Polish armies united and on 20 July they defeated Rákóczi in the Battle of Czarny Ostrów. After the defeat and subsequent retreat of his Cossack allies, Rákóczi withdrew towards the Podolian town of Miedzyboz, where he capitulated to Jerzy Lubomirski, promising to break his alliance with Sweden, abandon the cities of Kraków and Brzesc Litewski, and pay a contribution in the total amount of over 4 million złotys. Polish commanders allowed his forces to march towards Transylvania, but on 26 July, Rákóczi was attacked by the Crimean Tatars, who at that time were allied with Poland-Lithuania. Rákóczi abandoned his army, leaving it in the hands of János Kemény. The Transylvanian camp, located near Trembowla, was captured by the Tatars on 31 July. Some 500 were killed, and about 11,000 Transylvanians were captured and taken to the Crimea. As a result, Rákóczi's army ceased to exist. On 3 November 1657, at the command of the Ottoman Empire, the Diet deposed him for undertaking an unauthorized war. But in January 1658 he was reinstated by a new session of the Diet at Medgyes. Again he was deposed by the Turkish Grand Vizier, and again reinstated as if nothing had happened. Finally the Turks invaded Transylvania, and Rákóczi died at Nagyvárad of wounds received at the battle of Gilău.