Mahmud II was the sultan of the Ottoman empire from 1808 to 1839.
Mahmud was something of a reformer. His most notable achievement was the massacre of the Janissary corps in 1826. Most of his reforms were not so successful, however, and he was confronted in 1821 with a major rebellion in Greece. Following the great power intervention which resulted in the Battle of Navarino in 1827 and a Russo-Turkish War in 1828-1829, Mahmud was forced to grant Greece its independence in 1832.
Mahmud appears to have been unable to effect the reforms he desired in the mode of educating his children, so that his son received no better education than that given to Turkish princes in the harem. His son Abd-ul-Mejid succeeded him.
Late in his reign, Mahmud became involved in disputes with his ambitious vassal Mehemet Ali, Wali (Governor) of Egypt. Mahmud had enlisted Mehemet Ali's help in suppressing the rebellion in Greece, but had not paid the promised price for his services. In 1831, the Wali declared war, and managed to take control of Syria and Arabia by war's end in 1833. In 1839, Mahmud resumed the war, hoping to recover his losses, but at the very time he died, the news was on its way to Constantinople that the empire's army had been signally defeated at Nezib by an Egyptian army led by Mehemet Ali's son, Ibrahim Pasha.