The Ottoman Empire perceived the Truce of Andrusovo as a threat and began to engage in a more active policy in the region. On 8 June 1668, Doroshenko became the sole hetman of all Ukraine and returned to the idea of putting Ukraine under Ottoman protection, knowing that it would be difficult to survive. Following negotiations, both parties agreed that 1,000 janissaries wouldn't be stationed in Kodak and Ukraine would not have to pay any tribute. Doroshenko also drafted 17 articles on the basis of which he would accept Ottoman protection. Doroshenko issued a letter of submission to the sultan on December 24, 1668, which was confirmed by the Sublime Porte by June 1669. When the Commonwealth attempted to unseat Doroshenko and take over the Hetmanate, the Ottomans declared war in 1672 and marched north on Kamianets-Podilskyi, with Doroshenko's Cossacks and the Crimean Tatars on their side. Following the war, the Ottomans signed a treaty with the Commonwealth, which handed the region of Podolia over to the Ottomans. Continued fighting with the Commonwealth resulted in the Ottomans ceding the province of Podolia back to the Commonwealth in the Treaty of Karlowitz. In 1674, the Muscovy invaded the Hetmanate and besieged the capital of Chyhyryn, leading the Ottomans and Crimean Tatars to send their armies to confront the Muscovites. The Muscovites withdrew before any confrontation happened, but the Ottomans razed and plundered the settlements in the Hetmanate that had been friendly to the Muscovites in accordance with "Darü’l-İslam". Doroshenko surrendered to the Muscovites 2 years later, in 1676.