The Ottoman Empire became involved in the war nine years later, when Charles XII of Sweden was defeated by Peter the Great in the Battle of Poltava and subsequently encamped the remnants of his army in Ottoman Bender.[12] This led to another confrontation between the sultan and the tsar, culminating in an Ottoman declaration of war and the unsuccessful Russian Pruth Campaign.[12] As a consequence, the treaty of Constantinople was superseded by the Treaty of the Pruth (1711), by which Azov was returned to the sultan and subsequently razed,[12] and the Peace of Adrianople (1713), which restored peace between the Russian and Ottoman empires scheduled to last twenty-five years.[13] Though the sultan declared war on Peter three times in the time between Pruth and Adrianople, no actual fighting occurred,[13] thus the Pruth treaty effectively ended the Ottoman intervention in the Great Northern War.[12]