In 1808, Mahmud's brother and predecessor, Mustafa IV ordered his execution along with that of his brother, the deposed Sultan Selim III, in order to defuse a rebellion. Selim was killed, but Mahmud safely hid and was placed on the throne after the rebels deposed Mustafa. The leader of this rebellion, Mustafa Bayrakdar, then became Mahmud's vizier and took the initiative in resuming reforms that had been terminated by the conservative coup of 1807 that had brought Mustafa IV to power. It was not long before the vezir was killed by rebellious Janissaries in a fire, however, and Mahmud was forced to temporarily abandon the reforms. Later in his reign, Mahmud's efforts at reform were more successful. His most notable achievement was the massacre of the Janissary corps in 1826.
During the reign of Mahmud II, the Greek War of Independence broke out (1821 - 1829) which resulted in his losing Morea and Rumeli to the newly-freed state. Towards the end of that war, Russian troops advanced on Constantinople and occupied Adrianople, forcing Mahmud to cede more territory around the Black Sea to Russia.
the main points of the more momentous measures may be advantageously surveyed together; and among the first in value as well as date next to the all-important army reforms (which will be separately considered), are the edicts, by which Sultan Mahmud, soon after he was emancipated from the military tyranny of the janisseries, closed the Court of Confiscations, and took away the power of the life and death from the Pashas. Previously to the first of these Firmans at the property of all persons banished or condemned to death was forfeited to the crown; and a sordid motive for acts of cruelty was thus kept in perpetual operation, besides the encouragement of a host of Delators of the vilest kind. By the second, it was rendered no longer in the power of a Turkish governor to doom men to instant death by a mere wave of his hand; but the Pashas, the Agas, and other officers, were enjoined that “they should not presume to inflict themselves the punishment of death on any man, whether Raya or Turk, unless authorized by a legal sentence pronounced by the Kadi, and regularly signed by the judge.” Even then an appeal was allowed to the criminal to one of the Kadiaskers of Asia or Europe, and finally to the Sultan himself, if the criminal chose to persist in his appeal.
About the same time that Mahmud ordained these just arid humane changes, he set personally an example of reform by regularly attending the Divan, instead of secluding himself from the labors of state, according to the evil practice, which had been introduced so long ago as the reign of Selyman Kanuni, and which had been assigned as one of the causes of the decline of the empire by a Turkish historian nearly two centuries before Mahmud’s time. Mahmud redressed some of the worst abuses connected with the Vakif’s, by placing the revenues under the administration of the state; but he did net venture, to apply this vast mass of property to the general purposes of’ flue government. With the military fiefs, the Timars and the Ziamets, he dealt more boldly. These had long ceased to furnish the old effective military force, for the purpose of which they worn instituted and by attaching them to the public domains, Mahmud materially strengthened the resources of the state, and put and end of host of corruptions. One of the most resolute acts of his ruling was suppression of the Dereh Beys, the hereditary local chiefs (with power to nominate their successors in default of male heirs), win, by one of the worst abuses of the Ottoman feudal system, had made themselves petty princes in almost every province of the empire. The reduction of these insubordinate feudatories was not effected at once, or without severe struggles and frequent insurrections. But Mahmoud steadily persevered in this great measures and ultimately the island of Cyprus became the only part of empire in which power, not emanating from the Sultan, allowed to be retained by Dere Beys. In dealing with the complicated questions caused by the embarrassed finances empire, of his empire, and by the oppression and vexatious ness with which certain imposts pressed upon particular classes, Mahmoud showed the best spirit of the best of the Kiuprilis. A Firman of February 22, 1834, abolished the vexatious charges which public functionaries, when traversing the provinces, bad long been accustomed to make on the inhabitants. By the same edict all collection of money, except at the two regular half-yearly periods, we denounced as abuses. “No one is ignorant,” said Sultan Mahmud in this document, “that I am bound to afford support to all my subjects against vexatious proceedings; to endeavour unceasingly to lighten, instead of increasing their burdens, and to ensure peace and tranquillity. Therefore, those acts of oppression are at once contrary to the will of God, and to my imperial orders.” The kharatch, or capitation-tax, though moderate in and exempting those who paid it from military service, had long been made an engine of gross tyranny, through the insolence and misconduct of the government collectors. The Firman of 1834 abolished the old mode of levying it, and ordained that in it should be raised by a commission composed of the Cadi the Musluman governors, and the Ayans, or municipal chiefs Rayas of each district. Many other financial improvements were effected, the narration of which would be too long for introdi here. By another important series of measures, the administrative government was simplified and strengthen large mass of sinecure offices was abolished, and the Sultan valuable personal example of good sense, and economy, organising the imperial household, and mercilessly suppressing all titles without duties, and all salaried officials without functions.
When he died from tuberculosis in 1839, his funeral was crowded by throngs of people who came to bid the sultan farewell. 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 Ottoman princes in the harem. His son Abd-ul-Mejid succeeded him.