Polish–Cossack–Tatar War (1666–1671)

The Polish–Cossack–Tatar War (Польсько-козацько-татарська війна, Wojna polsko-kozacko-tatarska) was fought between the Polish–Lithuanian Commonwealth and the Ottoman-allied states of the Cossack Hetmanate and the Crimean Khanate. It occurred in the aftermath of the Russo–Polish War of 1654–1667 and was a prelude to the Ottoman–Polish War of 1672—1676.

Hostilities
In 1666, Hetman Petro Doroshenko of the Cossack Hetmanate aiming to gain control of Ukraine but facing defeats from other factions struggling over control of that region (the Polish–Lithuanian Commonwealth and Tsardom of Russia) in a final bid to preserve his power in Ukraine, signed a treaty with the Ottoman Sultan Mehmed IV that recognized the Cossack Hetmanate as a vassal of the Ottoman Empire.

In the meantime, the Polish–Lithuanian Commonwealth's forces were trying to put down unrest in Ukraine, but were weakened by decades long wars (Khmelnytsky Uprising, The Deluge and Russo–Polish War of 1654–1667. Trying to capitalize on that weakness, Crimean Tatars, who commonly raided across the Polish–Lithuanian Commonwealth borders in search of loot and slaves, invaded, this time allying themselves with Zaporozhian Cossacks under the command of Hetman Petro Doroshenko. They were however stopped by the Polish–Lithuanian Commonwealth’s forces under the command of Hetman John III Sobieski, who stopped their first push (1666–1667), defeating them several times, and finally gaining an armistice after the Battle of Pidhaitsi in 6–16 October 1667.

In 1670, however, Hetman Petro Doroshenko tried once again to take over Ukraine, and in 1671 Khan Adil Giray, supportive of the Polish–Lithuanian Commonwealth, was replaced with a new one, Khan Selim I Giray, by the Ottoman Sultan Mehmed IV. Khan Selim I Giray entered into an alliance with Hetman Petro Doroshenko; but again like in 1666–1667 the Cossack–Tatar forces were defeated by Hetman John III Sobieski. Khan Selim I Giray then renewed his oath of allegiance to the Ottoman Sultan Mehmed IV and pleaded for assistance, to which the Ottoman Sultan Mehmed IV agreed. Thus an irregular border conflict escalated into a regular war, as the Ottoman Empire was now prepared to send its regular units onto the battlefield in a bid to try to gain control of that region for itself.