On 26 January 1699, a peace treaty was signed in Karlovice between, among others, Poland and Turkey. It put a definitive end to the period of wars between the two countries. The Commonwealth regained Podolia, lost in 1672, with a fortress in Kamyanets Podolski. Interestingly, after the collapse of Poland’s statehood at the end of the 18th century, Turkey never recognised the partition of the Polish state.
The period of the 17th century was a time of constant wars for Poland, which brought economic ruin to the country. Along with Russia and Sweden, Turkey was the country with which the Polish army met most often on the battlefield. The last period of armed conflict with the Ottoman Empire began in 1683, when the armies of the Republic of Poland, led by King Jan III Sobieski himself, set out to relieve Vienna, which ended in a great battle on the outskirts of the city on 12 September 1683 and the defeat of the Turkish army led by Grand Vizier Kara Mustafa.
In 1684, the Holy League was established, with Poland, Austria, the Republic of Venice, and Russia joining in 1686. The main premise of this alliance was for those states to regain territories lost to Turkey in previous years. Unfortunately, this alliance was not fully exploited, due to the lack of full coordination by all countries. The expeditions undertaken with great effort by Poland, did not yield tangible results. The largest of them in 1686 reached the capital of Moldavia but had to withdraw due to supply problems.
In 1698, peace talks involving Poland, Austria, Venice and Turkey began in Karlovice (the area of present-day Serbia). Poland was represented by Stanisław Małachowski, Voivode of Poznań. On 26 January, a peace treaty was signed under which the Polish Commonwealth regained Podolia with Kamyanets Podolski, which it had lost in 1672. The Peace of Karlovice finally ended the Polish-Turkish wars. The two states later maintained friendly relations. After the collapse of Poland at the end of the 18th century, the Ottoman Empire was the only state that did not recognise the partitions by Russia, Austria and Prussia.