In the spring of 1686, when the Moscow ambassadors were in the Ottoman Empire, negotiations were already underway in Moscow with the personal representatives of the King of the Polish-Lithuanian Commonwealth for the signing of a peace treaty. "Treaty of Perpetual Peace" with the Polish-Lithuanian Commonwealth was concluded on April 21. Moscow undertook to break the peace with the Ottoman sultan and the Crimean khan and immediately send troops to the Crimean crossings to protect the Polish-Lithuanian Commonwealth from Tatar attacks. The Polish-Lithuanian Commonwealth government, for its part, guaranteed that the Orthodox population in the Polish-Lithuanian Commonwealth could not be forced into Greek Catholicism, and that the higher Orthodox clergy would be ordained by the Metropolitan of Kyiv. However, this agreement could enter into force only after its signing by the King of the Polish-Lithuanian Commonwealth. As Jan Sobieski was on a military campaign in the Principality of Moldavia at that time, the treaty was confirmed by him only in the autumn of 1686. At the same time, Moscow decided to organize a military campaign against the Crimean Khan, an ally of the Ottoman Empire. This actual declaration of war on the Ottoman Empire almost crossed out the results of the mission of deacon Nikita Alekseev. On the way back from Constantinople, the Moscow ambassador, along with his diplomas, was arrested while passing through the Crimea. The Moscow government barely managed to release him by sending an important Tatar prisoner to the Crimean khan in exchange. As soon as Constantinople learned of Moscow's conclusion of an "eternal peace" with the Polish-Lithuanian Commonwealth, the position of Patriarch Dionysius became extremely unenviable. Opposition in the Synod immediately formed against him. Dissatisfied with Dionysius, the bishops accused him of secret ties with Moscow, citing the transfer of the Metropolitanate of Kyiv to the Moscow patriarch. As a result, Dionysius lost his patriarchate two months after his official accession to the throne of Constantinople. In 1687, the Council of Constantinople condemned Patriarch Dionysius for the transfer of the Metropolitanate of Kyiv to Moscow, assessing this act as simony, i.e. bribery, and deprived Dionysius of the patriarchal throne. Thus, the action of Patriarch Dionysius was declared illegal by the council.
