Right-bank Ukraine
On January 31, 1667 the Polish–Lithuanian Commonwealth and the Tsardom of Russia signed the Treaty of Andrusovo. Russia gained the control of Left-bank Ukraine, while the commonwealth maintained the rule of Right-bank Ukraine, which would be defended by Polish-Lithuanian and Russian forces. The end of the war gave time to commonwealth armies for reinforcement. At the same period Petro Doroshenko, Hetman of Right-bank Ukraine, in order to establish his rule in Right-bank Ukraine signed a treaty with Sultan Mehmed IV that recognized the Cossack Hetmanate as a vassal of the Ottoman Empire.