The Bocskai uprising, known in Hungary as Bocskai's War of Independence (Hungarian: Bocskai szabadságharc, Bocskai-felkelés) was a revolt which took place in Hungary, Transylvania and modern Slovakia during the Long Turkish War (between 1604 and 1606) against Emperor Rudolf II. The rebel leader was Stephen Bocskai, a Protestant Hungarian nobleman. The Ottoman wars had burdened the Kingdom of Hungary for years, causing famine and disease, and the armies of the Christian states had been weakened by losses to Ottoman and Tatar forces.
Rudolf II persecuted the Protestants, and the wealthy Hungarian noblemen were falsely accused of treason. Bocskai organized the revolt and persuaded the Hungarian military Hajduks to join, defeating the imperial forces and foreign mercenaries. The Hungarian nobility, soldiers and peasants (including the minorities) joined Bocskai's Hajduk army. Although he was supported by the Ottoman Empire, the Crimean Khanate, Moldavia, Transylvania, he prevented an Ottoman siege of Vienna. Bocskai was declared Prince of Transylvania and Hungary, but recognized that total Hungarian independence was impossible against the Habsburg monarchy and the Ottoman Empire. He blazed a political trail for his supporters: the preservation of an independent Transylvania, a potential base for the unification of Hungary. Based on the terms of the Treaty of Vienna in 1606, all constitutional and religious rights and privileges were granted to the Hungarians in both the Principality of Transylvania and Royal Hungary. The treaty also recognized Bocskai as the Prince of Transylvania and guaranteed the right of Transylvanians to elect their own independent princes in the future.