The Polish units protecting Volhynia under Wiśniowiecki were able to defend their fortified encampment at Zbarazh in July and August against the overwhelming Cossack and Tatar armies. Their situation was getting increasingly desperate when the main Crown forces under King John Casimir approached in a rescue attempt. The King was surprised by the enemy at the Battle of Zboriv, but Ossoliński saved the Polish army by successfully negotiating with İslâm III Giray, the Tatar Khan, who was becoming worried about the Cossacks' growing power. Since the Lithuanian forces under Janusz Radziwiłł also entered the Dnieper region, Khmelnytsky consented to ceasing of hostilities on favorable for him, the Cossacks and the Orthodox Church conditions negotiated in the Treaty of Zboriv (the Cossack Hetmanate was officially recognized by the Commonwealth).