At the beginning of the Khmelnytsky uprising in the early months of 1648, Polish forces tried to suppress it but suffered two defeats at the battle of Zhovti Vody and Korsun. This was followed by the death of king Władysław IV on 20 May N.S. and Chancellor Jerzy Ossolinski called for a congress of notables in Warsaw on 9 June, at which Zaslawski, Ostrorog and Koniecpolski were designated provisional commanders, and Adam Kisiel was instructed to enter into negotiations with Khmelnytsky. By 27 June, the Bratslav region, Volhynia and the southern Kyiv region were engulfed by the uprising, Khmelnytsky had halted at Bila Tserkva, Tughay Bey foraged with his horde, and the khan had returned to the Crimea with two hundred thousand captives. By August, Kysil's commission had failed and this period of truce was coming to an end. The Polish army organized in Galicia, headed by the unpopular triumvirate of Crown commissioners: Władysław Dominik Zasławski, Mikolaj Ostroróg, and Aleksander Koniecpolski, were all famously derided by Khmelnytsky as a peryna, latyna and dytyna, respectively. Zaslawski's army marched to Zbarazh on 16 August O.S. in the footsteps of another Polish army organized around Jeremi Wisniowiecki, who had been stationed in southern Volhynia "following the battles at Starokostiantyniv". These armies merged on 1 September O.S. at Chovhanskyi Kamin. Khmelnytsky was "sationed at the time with his army on the fields of Pyliavtsi southeast of Starokostiantyniv". An advance regiment commanded by Koniecpolski and Ostrorog crossed the Ikopot River at Rosolivtsi on 6 September O.S. and encountered a Cossack garrison near Starokostiantyniv, who overnight abandoned the town to the Polish army. Yet, rather than "establishing themselves in..this mighty fortress...they set out to take" Khmelnytsky's position at Pyliavtsi, convinced "he would do anything to avoid a battle" while awaiting the arrival of the Tatars. On 8 September O.S., Polish cavalry troops under the command of Mykola Zatsyvilkovsky approached the Cossack positions at Pyliavtsi, driving a Cossack reconnaissance patrol from the field, allowing the Polish army to camp on the Ikva opposite Khmelnytsky.
The battle
Following several days of minor battles, Khmelnytsky led his army on the morning of13 September O.S. shouting "For the faith, brave warriors, for the faith!", killing many Polish cavalrymen as they fled back across the Ikva. That night, the Polish commanders decided to retreat in corral formation to Starokostiantyniv, but while preparing for this retreat the next day, they would hold their position and fight under Wisniowiecki's command. However, "rumours began curculating among the troops... that the commanders had abandoned the camp and taken flight... and fear was turned into wholesale panic". "Everyone else began to flee, leaving behind wagons, cannon, and all kind of supplies... only the sick and maimed... remained", not stopping at Starokostiantyniv, Koniecpolski went to Brody, Ostrorog to Olesko, Zaslawski to Vyshnivets.
Aftermath
The Polesleft behind an "immense, unheard-of booty", including a hundred thousand loaded wagons, and the "Cossacks then threw themselves, completely unarmed,... into looting the camp", which "significantly weakened the victor's desire to launch a pursuit." Even the "Tatar Horde, arriving after the rout... paid no attention to taking prisoners... but applied themselves to keeping the assorted booty". A few days later, Khmelnytsky seized Zbaraż, "the residence of the Cossack's greatest enemy, Jeremi Wiśniowiecki", continued on to siege Lwów from 28 September until 15 October O.S., leaving after that city paid 500,000 zlotys worth of "money, metal, goods, and supplies". He then laid siege to Zamość on 27 October until 22 November O.S., before receiving 20,000 zlotys. The Polish Diet convened 26 September O.S. and elected Jeremi Wisniowiecki as Crown Hetman, Andrzej Firlej as Field Hetman, and John II Casimir Vasa as king on 17 Nov., who sent Jakub Smiarowski to ask Khmelnytsky to withdraw "to the usual places". Khmelnytsky departed Zamość on 24 November, the king confirmed Khmelnytsky as hetman in December and Khmelnytsky entered Kiev before Christmas.