Lubomirski's rebellion or Lubomirski's rokosz (), was a rebellion against Polish King John II Casimir, initiated by the Polish nobleman Jerzy Sebastian Lubomirski. In 1665–66, Lubomirski's supporters paralyzed the proceedings of the Sejm. Lubomirski himself, with the support of part of the army and the levée en masse (pospolite ruszenie), defeated royal forces, at the Battle of Matwy (1666). The rebellion ended with the Agreement of Łęgonice, which forced the King to give up his planned reforms and the introduction of vivente-rege royal elections. Lubomirski himself, now a broken man, died soon after. Background The mid-17th century was one of the most tragic and difficult periods in the history of the Polish–Lithuanian Commonwealth. The country was devastated by several wars, such as the Khmelnytsky Uprising and the Swedish invasion of Poland. Its international position was weakened, and the chaos was deepened by the ill-functioning system of nobles' democracy (see szlachta privileges, Golden Liberty). In 1652 a Lithuanian deputy to the Sejm, Wladyslaw Sicinski, for the first time in Polish history used the liberum veto, voiding a bill that was about to be introduced. The country was riven by internal conflicts among the magnates, and its central institutions did not function. King John II Casimir Vasa was aware of the condition of the Polish–Lithuanian state and initiated an attempt to reform its institutions. In 1658, he introduced a program of improvement of the government, which stipulated, among others, voting by majority, creating a government and general tax system. The Polish Senate tentatively agreed to the reforms, creating a special commission. The problem was the issue of the royal election (see Royal elections in Poland) – the king and his supporters wanted to introduce the Vivente rege system, while his opponents disagreed. The King and his wife Marie Louise Gonzaga began to look for supporters among the nobility and the magnates. Their opponents, acting on the initiative of Habsburg envoy Franz Paul de Lisola, created their own camp, with such members as Greater Poland's Łukasz Opaliński and Jan Leszczyński, as well as Lesser Poland's Jerzy Sebastian Lubomirski. As a result, all attempts at the reform were defeated. The rebellion During the 1661 Sejm, the King urged all envoys to support extra taxes, needed to carry out election reform and pay the unpaid soldiers of the army. In response, the magnates opposed royal proposal, and upon inspiration of Lubomirski, a confederation called Holy