The next conflict between Russia and Turkey began 100 years later as part of the struggle for the territory of Ukraine. While Russia conquered the Left-bank Ukraine after the Russo-Polish War (1654-1667), Ottoman Empire in the course of the Polish–Ottoman War (1672–1676), spread its rule over all of the Right-bank Ukraine with the support of its vassal, Petro Doroshenko (1665–1672). The latter's pro-Ottoman policy caused discontent among many Ukrainian Cossacks, who would elect Ivan Samoilovich as a sole Hetman of all Ukraine in 1674. In 1676, Russian troops captured Chigirin and overthrew Doroshenko, who was exiled to Russia. In 1677, the Ottoman army tried to retake Chigirin, but was defeated. In 1678, the Ottoman army was finally able to take Chigirin after a bloody assault. But on this the Ottoman expansion to the northeast was stopped. In 1679–80, the Russians repelled the attacks of the Crimean Tatars and signed the Treaty of Bakhchisarai on January 13, 1681, which would establish the Russo-Turkish border by the Dnieper River.