Bayraktar and his troops entered the second court of the palace to be greeted by Selim’s body being thrown down from an upper window.
Mustafa, a son of Abdul Hamit I, was nearly twenty-eight years old when he took the throne having spent the previous eighteen years of his life in the Cage. As he was personally incapable of ruling, power fell into the hands of the Grand Vizier and his deputy who immediately began to fight for supremacy.
Meanwhile opposition to the new regime was led by Bayraktar Mustafa Pasha who assembled all his troops at Ruschuk on the Danube, where they devised a plan to depose Mustafa and return Selim to the throne. This plan had to be kept secret so that Mustafa would not kill Selim. Bayraktar moved his troops to Edirne and then to Istanbul where they arrived on 18 July 1808.
Eight days of devious manoeuvring followed as the Ruschuk committee tried to free Selim from the palace so that they could depose Mustafa and restore Selim to the throne. On 27 July the plot became known to the sultan, and Mustafa sent the chief black eunuch to kill Selim, and his own brother Mahmut, which would have left Mustafa as the only living male in the imperial Ottoman line.
Bayraktar and his troops entered the second court of the palace to be greeted by Selim’s body being thrown down from an upper window. Bayraktar overcame his initial grief at this sight, forced his way into the palace and seized Mustafa. Meanwhile Mahmut had narrowly escaped death by fleeing onto the roof of the harem.
Bayraktar followed the well-worn routine of obtaining a fetva from the şeyhülislam, and Mustafa was deposed and returned to the Cage on 28 July 1808. His brother Mahmut became Sultan Mahmut II.