Russia's influence waxed in Walachia and Moldavia as Ottoman power waned. In 1739 and 1769, the Russians briefly occupied the principalities. Then in 1774, Catherine the Great agreed to return Moldavia, Walachia, and Bessarabia to the Turks, but she obtained the right to represent Orthodox Christians within the Ottoman Empire and oversee the principalities' internal affairs. In 1787, the Imperial Russian Army again marched into the principalities, but a stalemate gripped forces on all fronts and in 1792 the empress and sultan agreed to reaffirm existing treaties. In 1802, the Porte agreed to halt the rapid turnover of Phanariot princes; henceforth, the princes would reign for seven-year terms and could not be dethroned without Russian approval.
