Ottomans, due to the insubordination of local princes associated with the rise of Imperial Russia's power under Peter the Great and the firm presence of the Habsburg Empire on the Carpathian border with the principalities. Dissidence in the two countries became dangerous for the Turks, who were confronted with the attraction on the population of protection by a fellow Eastern Orthodox state. This became obvious with Mihai Racoviță's second rule in Moldavia, when the prince plotted with Peter to have Ottoman rule overthrown. His replacement, Nicholas Mavrocordatos, was the first official Phanariot in his second reign in Moldavia and replaced Ștefan Cantacuzino in Wallachia as the first Phanariot ruler of that country. A crucial moment was the Russo−Turkish War of 1710−1713, when Dimitrie Cantemir sided with Russia and agreed to Russian tutelage of his country. After Russia experienced a major defeat and Cantemir went into exile, the Ottomans took charge of the succession to the throne of Moldavia. This was followed by similar measures in Wallachia, prompted by Ștefan Cantacuzino's alliance with Habsburg commander Prince Eugene of Savoy in the closing stages of the Great Turkish War. Rulers and retinues The person raised to the office of prince was usually the chief dragoman of the Porte, well-versed in contemporary politics and Ottoman statecraft. The new prince, who obtained his office in exchange for a generous bribe, proceeded to the country he was selected to govern (whose language he usually did not know). When the new princes were appointed, they were escorted to Iași or Bucharest by retinues composed of their families, favourites and creditors (from whom they had borrowed the bribes). The prince and his appointees counted on recouping these in as short a time as possible, amassing an amount sufficient to live on after their brief time in office. Thirty-one princes, from eleven families, ruled the two principalities during the Phanariot epoch. When the choice became limited to a few families due to princely disloyalty to the Porte, rulers would be moved from one principality to the other; the prince of Wallachia (the richer of the two principalities) would pay to avert his transfer to Iaşi, and the prince of Moldavia would bribe supporters in Constantinople to appoint him to Wallachia. Constantine Mavrocordatos ruled a total of ten times in Moldavia and Wallachia. The debt was owed to several creditors, rather than to the Sultan; the central institutions of