To further increase his military strength Doroshenko allied with Adil Giray, the khan of the Crimean Khanate.
Polish-Lithuanian forces under John III Sobieski, made up mostly of armed villagers, orthodox Galician Ruthenians who remained loyal to Polish kings since the beginning of Chmelnitsky's uprising,[citation needed] encamped themselves on the southern part of Podhajce in order to gain a strategic advantage against the army of Doroshenko.
After the failure of consecutive attacked, Doroshenko unsuccessfully besieged the town of Podhajce, which was defended by Jan Sobieski.
[3] Ivan Sirko's incrusion into Crimea diverted a large number of Tatars which played a role in the outcome of this battle, and the rebellious Hetman Doroshenko recognized the power of the Commonwealth over the Cossacks.
[7][8] After defeating Doroshenko in Podhajce, John III Sobieski was promoted to commander-in-chief of the Polish-Lithuanian army and Grand Crown Hetman, the highest military rank in the Polish–Lithuanian Commonwealth.