Turkish supply line in Hungary. At the Battle of Saint Gotthard (1664), Austrians and Hungarians defeated the Turkish army. After the Ottoman siege of Vienna failed in 1683, the Habsburgs went on the offensive against the Turks. By the end of the 17th century, they managed to invade the remainder of the historical Kingdom of Hungary and the principality of Transylvania. For a while in 1686, the capital Buda was again free from the Ottoman Empire, with the aid of other Europeans. The Kuruc age Rákóczi's War for Independence (1703–1711) was the first significant freedom fight in Hungary against absolutist Habsburg rule. It was fought by a group of noblemen, wealthy and high-ranking progressives who wanted to put an end to the inequality of power relations, led by Francis II Rákóczi (II. Rákóczi Ferenc in Hungarian). Its main aims were to protect the rights of the different social orders, and to ensure the economic and social development of the country. Due to the adverse balance of forces, the political situation in Europe and internal conflicts the freedom fight was eventually suppressed, but it succeeded in keeping Hungary from becoming an integral part of the Habsburg Empire, and its constitution was kept, even though it was only a formality. After the departure of the Ottomans, the Habsburgs dominated the Hungarian Kingdom. The Hungarians' renewed desire for freedom led to Rákóczi's War for Independence. The most important reasons of the war were the new and higher taxes and a renewed Protestant movement. Rákóczi was a Hungarian nobleman, son of the legendary heroine Ilona Zrínyi. He spent a part of his youth in Austrian captivity. The Kurucs were troops of Rákóczi. Initially, the Kuruc army attained several important victories due to their superior light cavalry. Their weapons were mostly pistols, light sabre and fokos. At the Battle of Saint Gotthard (1705), János Bottyán decisively defeated the Austrian army. The Hungarian colonel Ádám Balogh nearly captured Joseph I, the King of Hungary and Archduke of Austria. In 1708, the Habsburgs finally defeated the main Hungarian army at Battle of Trencsén, and this diminished the further effectiveness of the Kuruc army. While the Hungarians were exhausted by the fights, the Austrians defeated the French army in the War of the Spanish Succession. They could send more troops to Hungary against the rebels. Transylvania became part of Hungary again starting at the end of the 17th