Principality of Upper Hungary

The Principality of Upper Hungary (Felső-Magyarországi Fejedelemség; او رتا ماجار) was a short-lived Ottoman vassal state ruled by Imre Thököly.

Background
After peace treaty of Vasvár was signed in 1664, loyalty felt by Hungarians towards the Habsburg dynasty was in decline. The Hungarian nobility was dissatisfied by Emperor Leopold I's refusal to capitalize on the victory at the Battle of Saint Gotthard to liberate more of the Hungarian lands from the Ottomans, and the subsequent Imperial administration of Hungary was seen as acting against interests of the Hungarian estates. In 1671 a rebellion was successfully thwarted. However, a year later Mihály Teleki led a more successful rebellion. In 1673 the Emperor appointed Johann Caspar von Ampringen, the Teutonic Grandmaster as governor of Royal Hungary, precipitating a harsh crackdown on disloyal nobles and Protestants which further increased the resentment of the Hungarian nobility against the Habsburgs. In 1680 Imre Thököly became the leading figure of the rebellion, which started being supported and sustained by the Ottoman state and the Principality of Transylvania.

Establishment and later history
The principality was established on 19 November 1682. The polity agreed to pay 20,000 gold coins to the Ottomans annually. In 1685 Thököly was defeated at Eperjes (present-day Prešov) and the Turks imprisoned him because of his previous negotiations with Leopold therefore his realm ceased to exist.