tern and central Ukraine, but, deserted by his Tatar allies, he suffered a crushing defeat at Berestechko, and turned to the Russian tsar for help.
In 1654, Khmelnytsky signed the Treaty of Pereiaslav, forming a military and political alliance with Russia that acknowledged loyalty to the Czar. The wars escalated in intensity with hundreds of thousands of deaths. Defeat came in 1686 as the "Eternal Peace" between Russia and Poland gave Kiev and the Cossack lands east of the Dnieper over to Russian rule and the Ukrainian lands west of the Dnieper to Poland.
In 1709 Cossack Hetman Ivan Mazepa (1687–1709) sided with Sweden against Russia in the Great Northern War (1700–1721). Mazepa, a member of the Cossack nobility, received an excellent education abroad and proved to be a brilliant political and military leader enjoying good relations with the Romanov dynasty. After Peter the Great became czar, Mazepa as hetman gave him more than twenty years of loyal military and diplomatic service and was well rewarded.
Eventually Peter recognized that in order to consolidate and modernize Russia's political and economic power it was necessary to do away with the hetmanate and Ukrainian and Cossack aspirations to autonomy. Mazepa accepted Polish invitations to join the Poles and Swedes against Russia. The move was disastrous for the hetmanate, Ukrainian autonomy, and Mazepa. He died in exile after fleeing from the Battle of Poltava (1709), where the Swedes and their Cossack allies suffered a catastrophic defeat at the hands of Peter's Russian forces.
The hetmanate was abolished in 1764; the Zaporizhska Sich abolished in 1775, as Russia centralized control over its lands. As part of the partitioning of Poland in 1772, 1793, and 1795, the Ukrainian lands west of the Dnieper were divided between Russia and Austria. From 1737 to 1834, expansion into the northern Black Sea littoral and the eastern Danube valley was a cornerstone of Russian foreign policy