text: The outbreak of the War of the Spanish Succession (1701–1715) provided an opportunity for the discontented Hungarians to rise against Leopold. They regarded one of the wealthiest aristocrats, Prince Francis II Rákóczi (d. 1735), as their leader. Rákóczi's War of Independence lasted from 1703 to 1711. Although the rebels were forced to yield, the Treaty of Szatmár granted a general amnesty for them and the new Habsburg monarch, Charles III (), promised to respect the privileges of the Estates of the realm.
  Cooperation and absolutism
  Charles III again confirmed the privileges of the Estates of the "Kingdom of Hungary, and the Parts, Kingdoms and Provinces thereto annexed" in 1723 in return for the enactment of the Pragmatic Sanction which established his daughters' right to succeed him. Montesquieu, who visited Hungary in 1728, regarded the relationship between the king and the Diet as a good example of the separation of powers. The magnates almost monopolized the highest offices, but both the Hungarian Court Chancellerythe supreme body of royal administrationand the Lieutenancy Councilthe most important administrative officealso employed lesser noblemen. In practice, Protestants were excluded from public offices after a royal decree, the , obliged all candidates to take an oath on the Virgin Mary.