Mahmud II, 1784–1839, Ottoman sultan (1808–39), younger son of Abd al-Hamid I. He was raised to the throne of the Ottoman Empire (Turkey) upon the deposition of his brother, Mustafa IV, and continued the reforms of his cousin, Selim III. During his reign, the Eastern Question assumed increasing importance. Mahmud inherited the Russo-Turkish War of 1806–12, which ended with Turkey's loss of Bessarabia. However, Russia was obliged to end its support of the Serbian rebels under Karageorge, and Serbia returned (1813) to Turkish control. In 1817, Mahmud recognized Miloš as prince of Serbia, a Turkish vassal. He suppressed (1822) the rebellion of Ali Pasha and defeated the Greeks in the first phase of the Greek War of Independence. At the height of his power he ruthlessly carried out (1826) a long-cherished project—the destruction of the Janissaries. The Turkish successes in Greece were largely due to the troops sent by the viceroy of Egypt, Muhammad Ali, under the command of Ibrahim Pasha. British, Russian, and French intervention led to the destruction (1827) of the Egyptian fleet at Navarino, the Russo-Turkish War of 1828–29, a humiliating peace (see Adrianople, Treaty of), and the independence of Greece. The sequel of the Greek war was the invasion of Turkey by Ibrahim Pasha after Mahmud had refused to give Syria to Muhammad Ali as reward for his aid against the Greeks. At Konya, the Turkish army was completely routed (1832), and Constantinople was saved only by the intervention of a Russian fleet. Mahmud was obliged to accede (1833) to Muhammad Ali's demands and, by a secret agreement with Russia, promised to close the Dardanelles to all warships hostile to Russia. In 1839, war with Egypt was resumed, and on the day of Mahmud's death, news came of the ignominious surrender of the Turkish fleet in the harbor of Alexandria. Mahmud's son and successor, Abd al-Majid, granted Egypt virtual independence.