Alemdar Mustafa Pasha

In July 1808, he took power in a military coup, replacing Sultan Mustafa IV with Mahmud II and becoming grand vizier.

[5] According to Kemal Beydilli, he was born in Hotin (modern-day Khotyn, Ukraine), although his father was a janissary from Rusçuk named Hacı Hasan Ağa.

It was during his service in the Russo-Turkish War of 1768–1774 that he acquired the epithet bayraktar or alemdar,[1] both meaning 'flag-bearer' and probably referring to his military rank in the janissary corps,[2] although another source suggests that he received it later.

He became a close associate of Ismail Ağa Tirseniklioğlu, the leader of Rusçuk and a powerful provincial notable in the Ottoman Balkans (Rumelia).

After Alemdar's arrival, Mustafa IV ordered the killing of Selim III and Mahmud II, succeeding in the former case.

As grand vizier, Alemdar purged the soldiers who had rebelled against Selim, removed conservatives from government positions and replaced them with men sympathetic to reform.

He modernised the army and navy and attempted to reform the Janissaries, but Mahmud, fearing a political backlash by the elite corps, halted these changes.

[6] After Mustafa IV learned of these events, he decided to have his uncle, Selim III, and his younger brother, Prince Mahmud, killed so that he should be the only surviving member of the imperial family.

First of all, Alemdar made an agreement with the rebel representative from Anatolian lands, which was called the Charter of Alliance (Sened-i Ittifak).

Realising he could not survive the assault, he ignited the gunpowder reserves in the cellar of his house, killing himself and approximately 400 Janissaries in the ensuing explosion.