The steppe borderland between Poland-Lithuania, Muscovy, various Tatar states and the Black Sea was mostly under control of the Polish-Lithuanian commonwealth, at least since the fall of Kievan Rus'. However, control over such a huge area was never direct and far from complete. The vast, scarcely populated areas of what is now Ukraine had been attracting all sorts of people, from adventurers to brigands, foreign merchants, landless gentry and runaway serfs. Over time a certain common identity started to form among them, giving birth to the Cossacks. The Republic tried to strengthen control over those lands by creating the so-called Cossack registry, a small yet well-trained and well-equipped unit formed of local folk, tasked above all with policing and peace-keeping duties in the Kiev Voivodeship, and most importantly in the so-called Wild Fields. Although in the 16th century the unit was at no time stronger than 1000 men, it was nevertheless a formidable force in an area where no large settlements existed. In addition, unlike the force fielded by and loyal to the central authorities rather than local magnates--who often fielded their own armies--the Registered Cossacks were to be paid in the same manner as other Polish-Lithuanian standing army units: the local voivodes and castellans were to distribute salaries to them once a year. However, the salaries were being paid irregularly and the basic source of income for the armed Cossacks remained pillaging raids on Zaporizhian Sich, Crimea, Moldavia and other lands under Ottoman control. The international situation of the Cossacks and Polish-Lithuanian control over the vast areas of Kiev Voivodeship was further complicated by the fact that the rulers of Muscovy and Austria wanted to win the support of Cossacks in their struggle against the Turks. In 1591 the so-called Kosiński Uprising started. What started as a private quarrel between one disgruntled Polish noble and some local Ruthenian magnates soon turned into a full-scale civil war between local Ruthenian nobility and the Cossacks. Despite initial successes, the Cossacks started to lose ground and were ultimately defeated by Polish-led levée en masse in the battle of Piątek near Zhitomir. By 1593 the rebellion was quelled and Krzysztof Kosiński killed. Nalyvaiko, who initially served in private units of Janusz Ostrogski, took an active part in the suppression of the uprising. The Sejm, or the parliament of the Polish-Lithuanian Commonwealth, declared all Cossacks who took part in the rebellion to be guilty of high treason, but pardoned them soon afterwards and the Cossacks were allowed to keep their boats and arms. Meanwhile, the army of the Crown of Poland, led at the time by hetmanStanisław Żółkiewski, started a new campaign in Moldavia and Transilvania in support of Ieremia Movilă's claims to the Moldavian throne.
The uprising
Nalyvaiko left Polish service in 1594, organized a paramilitary unit of unregistered Cossacks in the vicinity of Bratslav and raided several Moldavian and Hungarian towns. Nalyvaiko led his men through Galicia, Volhynia and Belarus. His Cossacks and rebel Ukrainianpeasants took the cities of Bratslav, Husiatyn, Bar, Lutsk, Kaniv, Cherkasy and Slutsk, Babruisk, and Mahiliou in Belarus. The following year Nalivaiko's Cossacks were joined by many runaway Ukrainian peasants and together they captured the town of Lutsk, where his men massacred Polish nobility, Catholic clergy and local Greek-Catholics. From Volhynia Nalivaiko's Cossacks moved into Belarus, where they pillaged Mogilev. Nalivaiko eventually offered peace to Polish kingSigismund III Vasa, conditioned that the Poles cede the lands between Southern Buh and Dniester rivers south of Bratslav to the Cossacks in exchange for their military service and loyalty to the Polish-Lithuanian Commonwealth. Having refused these terms, the king recalled Hetman Stanisław Żółkiewski from Moldavia. In 1595 Żółkiewski and the royal army set out to end the rebellion. In response to this, Nalivaiko joined his forces with the Zaporozhian Cossack HetmanHryhory Loboda, but was forced to retreat to left-bank Ukraine, even after defeating the Poles at Bila Tserkva. In May 1596 the Cossack tabor was surrounded by Polish forces near the town of Lubny. The Cossacks fought for two weeks before running out of food and water. After two weeks of siege, there was unrest as the Cossacks began to run out of food and water. Loboda was murdered, and on 7 July 1596 Nalyvaiko was handed over by the Cossacks to the Poles as a condition of surrender in exchange for their own lives, but the agreement was not kept, and Cossacks were attacked by the Poles immediately after Nalivaiko's surrender. Nalyvaiko was brought to Warsaw, where he was tortured, drawn and quartered and put on public display. After the rebellion all Cossack lands were taken and given to the Polish magnates. Nalyvaiko became a legend and a hero of Ukrainian folklore.