War came to an end in 1821 with the Peace of Bucharest. The river Pruth was agreed as the frontier between the two countries and Walachia and Moldavia returned to Turkey.
The Greeks of Morea now rose in rebellion. It was put down but England, France and Russia formed an alliance. They destroyed the Ottoman-Egyptian fleet at Nevarin and Russia seized Walachia and Moldavia once more. The fortress of Calas, Ibrael, Isakchi, Tolchi, Machin and Silistre were lost and Russian forces advanced as far as Edirne and the eastern region of Anatolia. The Peace of Edirne ended the war with large parts of Anatolia abandoned to the Russians. In 1830 Turkey accepted the establishment of an independent Greek Empire.
Most manifestations of decline were only continuations and elaborations of earlier conditions. In the later Ottoman period, however, a new factor of decline was added: the weakness of the central government resulted in the loss of control of most of the provinces to the local ruling notables, called ayan or derebeyis ("lords of the valley") in Anatolia and klephts or hayduks in Europe, who took more or less permanent control of large areas, creating a situation that in many ways resembled European feudalism much more than the traditional Ottoman timar system ever did.
In the Balkans and Anatolia local rulers solidified their positions by taking advantage of currents of local nationalism that were arising among the Balkan Christians. The notables formed private armies of mercenaries and slaves, which they sometimes used to provide important contributions to the Ottoman armies in return for recognition of their autonomy by the sultans. These rulers were able to exercise almost complete authority, collecting taxes for themselves and sending only nominal payments to the treasury, thus further increasing its problems.
France now occupied Algeria. Mehmet Ali Pasha, the Governor of Egypt, rebelled and advanced as far as Kutahia Sultan Mahmoud asked Russia for help and this was agreed in 1833. As part of the agreement Mehmet Ali Pasha was made Governor of Syria and Governorship of Adana was abandoned to Ibrahim Pasha.