The Battle of Brailov (Ukrainian: Битва під Браїловим, Polish: Bitwa pod Braiłowem) was the first battle of the Polish–Cossack–Tatar war that took place on 19 December 1666 between the joint Cossack-Tatar army led by Petro Doroshenko and the Polish-Lithuanian army led by Sebastian Machowski. It ended in a Cossack-Tatar victory with Machowski taken prisoner. Background. A peace talks were helt between Russian Tsardom and the Polish-Lithuanian Commonwealth in the year 1666 about the partition of Cossack Hetmanate along the Dnieper river. Fearing this, Petro Doroshenko has signed an alliance with the Crimean Khanate in order to maintain independence of the Right-Bank Ukraine from Poland-Lithuania. In November of 1666, several Polish-Lithuanian units had entered Ukraine, including Machowski's units, who, in the second decade of December, launched a punitive campaign against the Doroshenko's Cossacks. Doroshenko, however, decided to attack the Polish-Lithuanian forces on their way to Kiev region. Battle. In the night of December 18, Doroshenko's Cossacks, aided by the Tatar army, attacked the advancing Polish forces near Brailiv (now Ukraine). Sebastian Machowski, trying to halt the Allied offensive, left a powerful rearguard to hold back the Cossack-Tatar advance and began preparing the cavalry for the battle, positioning it further from Brailov on the Rov river. In the morning of 19 December, Machowski launched a counterattack but was defeated and the battle renewed. Facing defeat, the Poles began retreating to Letychiv, chased by the joint Cossack-Tatar army. Aftermath. Most of the Polish-Lithuanian army was either killed or captured and Machowski, who was taken prisoner in the battle, was sent to Crimea. Petro Doroshenko continued his campaign against the Commonwealth - in February 1667 he besieged the city of Bila Tserkva and in September 1667 he captured the . However, the Western campaign of the Cossacks and Tatars was stopped after the Battle of Podhajce.