The Commonwealth had little ability to control the activities of the Cossacks, and in 1648 Ukraine descended into chaos with the Khmelnytsky Uprising, whereby the Cossacks sought to overthrow the control of the Commonwealth and establish an independent state. War continued for nearly twenty years, leading to the intervention of Russia and Sweden, among others. In 1669 Cossack Hetman Petro Doroshenko turned to the Ottomans, offering his state of Right-Bank Ukraine as a vassal in exchange for protection from the Commonwealth and Russia. The Ottomans accepted his offer, seeing this as an opportunity to bring an end to perennial Cossack raiding and to shore up the defenses of the northern frontier. Following a Commonwealth attack on the Cossacks, the Ottomans went to war and in 1672 conquered the fortress of Kamianets-Podilskyi, known to the Ottomans as Kamaniçe. Peace was signed in 1676, whereby the Ottomans annexed the province of Podolia. The Ottomans thus acquired a strong foothold from which to increase their control over the Cossack state, and shortly thereafter established garrisons in the major towns of Ukraine, clashing with the Russians and expelling them from the traditional Cossack capital of Chyhyryn in 1678. Kamaniçe remained the bulwark of the Ottoman northern frontier throughout the War of the Holy League. With a garrison of over 6,000 men and 200 cannons, it was one of the most heavily defended fortresses in the Ottoman Empire. Despite continuous attempts by the Commonwealth to blockade and besiege the city, Kamaniçe managed to hold out throughout the war, and in accordance with the Treaty of Karlowitz was returned to the Commonwealth in 1699 without having been conquered.