the following year. Of great importance was the Volhynia victory of Jerzy Lubomirski and Stanisław Potocki over Vasily Sheremetev in the Battle of Chudniv in October 1660. Yurii Khmelnytsky, also defeated, agreed there to submit to John Casimir and approved a weaker (for the Cossacks) version of the Treaty of Hadiach. The Commonwealth's defense and the retaking of the greater portion of the Grand Duchy of Lithuania, however successful, had not resulted in the recovery of all the lands lost in the 1650s. Smolensk was left in Russian hands and Ukraine became divided, with the right (western) bank of the Dnieper River (under Yurii Khmelnytsky) tied to the Commonwealth, and the left bank to Russia under the terms of the Pereyaslav treaties. With the Zaporizhian center also conducting its own politics, the whole division of Ukraine resulted in a highly volatile situation and internal warfare, known in Ukrainian history as the Ruin. In January 1663 in Chyhyryn the pro-Polish Pavlo Teteria was elected Cossack hetman, but his authority was not recognized in left-bank Ukraine, where in June Ivan Briukhovetsky was chosen with Russian support. John Casimir made one more attempt to reverse the losses and regain all of Ukraine by attacking the Tsardom in 1663 and 1664. While some of his forward units approached Moscow, fighting the Russian people and weather took its toll, which combined with the internal difficulties at home made the withdrawal unavoidable. The Commonwealth's failures encouraged anti-Polish sentiments in right-bank Ukraine. The popular uprisings there were subdued with great effort, with Hetman Czarniecki dying in the fighting in 1665. The Commonwealth nobility attempted return to their Ukrainian possessions and the warfare caused widespread destruction in Ukraine. In 1665, as the Crown forces were being withdrawn from right-bank Ukraine, the pro-Polish orientation among the Cossacks was greatly diminished and Teteria lost power. During the Polish–Cossack–Tatar War (1666–71), on Dec. 19, 1666 the new right-bank hetman Petro Doroshenko renewed the Cossack-Tatar alliance and eliminated near Vinnytsia the Polish forces stationed in the region, ending in reality the Polish military rule over Ukraine. In the years that followed, Doroshenko led Cossack fighters and participated in political maneuvers involving the Commonwealth, Russia and the Ottoman Empire in vain pursuit of Khmelnytsky's dream of building a strong Ukrainian state. Under the pressure of the Ukrainian unrest and the threat of a Turkish–Tatar intervention, the Commonwealth and Russia signed in 1667 an