In the period 1657–1686 came "The Ruin", a devastating 30-year war amongst Russia, Poland, the Crimean Khanate, the Ottoman Empire, and Cossacks for control of Ukraine, which occurred at about the same time as the Deluge of Poland. The wars escalated in intensity with hundreds of thousands of deaths. The "Treaty of Perpetual Peace" between Russia and Poland in 1686 divided the lands of the Cossack Hetmanate between them, reducing the portion over which Poland had claimed sovereignty.