Rákóczi's War of Independence (1703–1711) was the first significant attempt to topple the rule of the Habsburgs over Hungary. The war was conducted by a group of noblemen, wealthy and high-ranking progressives and was led by Francis II Rákóczi and resigned soldiers and peasants fought alongside the noblemen. The insurrection was unsuccessful, ending with the Treaty of Szatmár; however, the Hungarian nobility managed to partially satisfy Hungarian interests. Prelude With the Treaty of Karlowitz in 1699, the Ottoman Empire renounced almost all of its claims to some of its territories, which were conquered from the medieval Kingdom of Hungary after 1526. The nobility was against Habsburg rule because the lands formerly taken away from them by the Ottomans were returned only to those who could prove their right to own the property and could pay 10% of its worth to the Habsburgs. If they failed to do so, the property went to creditors of the Empire. The peasant class turned against the Empire because of the hardships the long wars brought upon them. In 1697 an anti-Habsburg uprising in Tokaj was suppressed. However, relations between the court and the nobility were deteriorating, and the new Habsburg rulers treated the peasants so poorly that eventually some people wished for a return to Turkish rule. Uprising International relations provided Hungarians with an opportunity to liberate themselves from the Habsburgs. With the help of King Louis XIV of France, anti-Habsburg rebels, led by young nobleman Imre Thököly, rose against the Empire in 1678. Thököly occupied most of Northern Hungary. In 1681, the Ottomans joined to help him, and he was recognised as King of Upper Hungary by Sultan Mehmed IV. However, when the Ottomans lost the battle of Vienna in 1683, Thököly lost Ottoman support and was eventually defeated in 1685. His alliance with the Ottomans changed the positive perception Western Europe had about Hungary, and instead of being thought of as the bastion of Christianity, the country was now being thought of as an enemy, Partly as a consequence, Hungary was occupied and organised as "newly acquired territory" instead of "territory liberated from the Ottomans". Leadership Francis II Rákóczi () was the son of an old noble family and one of the richest landlords in the Kingdom of Hungary. He was the count (comes perpetuus) of the Comitatus Sarossiensis (in Hungarian Sáros) from 1694 on. He was born to Francis I Rákóczi,