Refusing to surrender to Habsburg Emperor Leopold I, Thököly lost his principality of Upper Hungary and finally retired to Galata, near Constantinople, with large estates granted him by Mustafa II.
Emeric was born in Késmárk in Royal Hungary (now Kežmarok in Slovakia) on 25 September 1657 as the fifth son of Count István Thököly and Mária Gyulaffy.
[1][2] Being an intelligent student, he quickly understood the main aspects of Lutheran theology and learnt to write long texts in perfect Latin.
[10] Hundreds of noblemen were dispossessed of their estates; foreign mercenaries replaced the Hungarian troops in the fortresses and started plundering the nearby towns and villages.
[10][11] Leopold I did not respect the fundamental laws of the kingdom and appointed a Directorium to administer Hungary in 1673, led by Johann Caspar von Ampringen, the Grand Master of the Teutonic Order.
[14] Apafi did not declare war on Leopold I, but promised to secure the professional command of the Kuruc troops and to provide asylum to them in case of defeats.
[18] Louis XIV's envoy, Abbé Dominique Révérend, who met with Imre around that time, described him as "the most powerful lord and the most honest man in Hungary".
[23] Although he had to abandon the mining towns after he was defeated at Barsszentkereszt (now Žiar nad Hronom in Slovakia) on 1 November, he continued to control 13 counties in Royal Hungary.
[23][24] Encouraged by promises of help from Louis XIV of France, the anti-Habsburg rebels now rose "pro libertate et justitia", and chose the youthful Thököly as their leader.
In June 1682 he married Croatian countess Jelena Zrinska (in Hungarian: Zrínyi Ilona), the widow of Prince Francis I Rákóczi.
[25] Thököly's distrust of the Emperor now induced him to turn for help to Sultan Mehmed IV, who gave him the title "King of Upper Hungary" (Ķıralı Orta Macar) – partly coinciding with present-day Slovakia – on condition that he pay an annual tribute of 40,000 tallers.
At the two Diets held by him, at Kassa (today Košice, Slovakia) and Tállya, in 1683, the estates, though not uninfluenced by his personal charm, showed some want of confidence in him, fearing he might sacrifice national independence to the Turkish alliance.
However, the campaign of 1685 was a series of disasters, he was defeated at Prešov (Eperjes) and when he sought help from the Turks at Nagyvárad they seized him and sent him in chains to Edirne (possibly because of his previous negotiations with Leopold), whereupon most of his followers made their peace with the Emperor.
In 1690, however, they dispatched him into Transylvania a third time with 16,000 men, and in September he routed the united forces of Gen. Donat Heissler and Count Mihály Teleki at Zărneşti.
After this great victory Thököly was elected prince of Transylvania by the Kereszténysziget (probably Oprişani now) Diet, but could not maintain his position for long against the imperial armies.