past for independence from the Polish–Lithuanian Commonwealth, and they were later involved in several uprisings against the tsar, in fear of losing their privileges and autonomy. In 1709, for example, the Zaporozhian Host led by Kost Hordiienko joined Hetman Ivan Mazepa against Russia. Mazepa was previously a trusted adviser and close friend to Tsar Peter the Great but allied himself with Charles XII of Sweden against Peter I. After the defeat at the Battle of Poltava Peter ordered a retaliatory destruction of the Sich. With the death of Mazepa in Bessarabia in 1709, his council elected his former general chancellor, Pylyp Orlyk, as his successor. Orlyk issued the project of the Constitution, where he promised to limit the authority of the Hetman, preserve the privileged position of the Zaporozhians, take measures towards achieving social equality among them, and steps towards the separation of the Zaporizhian Host from the Russian State—should he manage to obtain power in the Cossack Hetmanate. With the support of Charles XII, Orlyk made an alliance with the Crimean Tatars and Ottomans against Russia, but following the early successes of their 1711 attack on Russia, their campaign was defeated, and Orlyk returned into exile. The Zaporozhians built a new Sich under Ottoman protection, the Oleshky Sich on the lower Dnieper. Although some of the Zaporozhian cossacks returned to Moscow's protection, their popular leader Kost Hordiienko was resolute in his anti-Russian attitude and no rapprochement was possible until his death in 1733. Within the Russian Empire Over the years the friction between the Cossacks and the Russian tsarist government lessened, and privileges were traded for a reduction in Cossack autonomy. The Ukrainian Cossacks who did not side with Mazepa elected as Hetman Ivan Skoropadsky, one of the "anti-Mazepist" polkovniks. While advocating for the preservation for the Hetmanate autonomy and privileges of the starshina, Skoropadsky was careful to avoid open confrontation and remained loyal to the union with Russia. To accommodate Russian military needs, Skoropadsky allowed for stationing of ten Russian regiments in the territory of the Hetmanate. At the same time, Cossacks took part in construction, fortification and channel development projects in Saint Petersburg, as part of the effort by Peter the Great to establish the new Russian capital. Many did not return, and it is often stated that St. Peterburg "was built on bones". In 1734, as Russia was preparing for a new war against the Ottoman