Answer
Mustafa IV succeeded Selim III as the sultan of the Ottoman Empire following the latter's overthrow by a rebel janissary coup in 1807. However, Mustafa IV's reign was short-lived and marked by internal strife and military defeats. He was eventually deposed and killed in 1808 during the counter-coup led by Alemdar Mustafa Pasha, which installed Mahmud II as the new sultan.