In 1807, auxiliary troops (Yamaks) rebelled against the European-style uniforms, and the Janissaries joined them. Reformers among the sultan's counselors and ministers, blocked by a ruling of the grand mufti that such uniforms were contrary to Muslim law, were tried and executed. Selim was deposed; his relative Mustafa IV (1779-1808) acceded briefly until Selim's supporters stormed the palace, only to discover that Mustafa had ordered Selim strangled. The unruly Janissaries now dragged Mustafa from his throne, had him strangled with the usual bowstring, and proclaimed Mahmud II (1784-1839) sultan. The Janissaries' leader became the new grand vizier, who enthusiastically introduced Selim's New Order. But the Janissaries then proved they could be subtle as well as obstinate, for they feigned acceptance, detained the grand vizier, and murdered him, postponing their own annihilation for less than two decades.