In the 18th century, Poland was overwhelmed by far-reaching anarchy. The Polish-Lithuanian Commonwealth (as it was called after the Polish-Lithuanian Union in Lublin of 1569) plunged into an increasing political and economic chaos, and its internal affairs were more and more often interfered with by neighbouring countries: Russia, Prussia, and Austria. These countries often corrupted the representatives of the Polish nobility and magnates in order to prevent any reforms.
In 1772, as a result of the First Partition, Russia, Prussia and Austria deprived Poland of part of its territories. The partial occupation made a large part of the society aware of the need to conduct a thorough reform of the state. The supporters of the changes gathered around Stanisław Małachowski, Ignacy Potocki and Hugo Kołłataj as well as King Stanisław August Poniatowski. The greatest achievement of the reform movement was the Great Seym, also known as the Four-Year Seym, which debated from 1788 to 1792 and the adoption of the Constitution on May 3, 1791. In this way, Poland became the second country in the world (after the United States), and the first in Europe to have a constitution. It introduced the tripartite division of power, hereditary monarchy, abolished the internal division into Poland and Lithuania, partially equalized the rights of the burghers and nobility, abolished the liberum veto (the possibility of breaking the deliberations of the Seym) and took the peasants under the protection of the state.
The introduced reforms met with resistance from some magnates, who quickly found support in Russia ruled by Catherine II. This led to the signing of the Targowica Confederation Act, prepared and edited by Russia. The signatories of the confederation turned to Catherine II for military intervention in Poland in order to defend the old legal order. The Russian army entered the Polish borders. However, the Polish army under the command of Prince Józef Poniatowski and General Tadeusz Kościuszko resisted the invaders, but under the advantage of the Russian forces, it had to withdraw. The war in defence of the Constitution of May 3 ended with the accession of King Stanisław August Poniatowski to the supporters of the confederation. The very concept of the Targowica confederation has become a synonym of national treason for Poles. Soon, in 1793, the Second Partition of Poland was carried out by Russia and Prussia.