After the
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==