Selim III was the Sultan of the Ottoman Empire from 1789 to 1807. Although regarded as an enlightened ruler, the Janissaries eventually deposed and imprisoned him, and placed his cousin Mustafa on the throne as Mustafa IV. Selim was subsequently killed by a group of assassins.
Selim III was the son of Sultan Mustafa III and his wife Mihrişah Sultan. His mother Mihrişah Sultan originated in Georgia, and when she became the Valide Sultan, she participated in reforming the government schools and establishing political corporations. His father Ottoman Sultan Mustafa III was very well educated and believed in the necessity of reforms. Mustafa III attempted to create a powerful army during the peacetime with professional, well-educated soldiers. This was primarily motivated by his fear of a Russian invasion. During the Russo-Turkish War, he fell ill and died of a heart attack in 1774. Sultan Mustafa was aware of the fact that a military reform was necessary. He declared new military regulations and opened maritime and artillery academies.
Sultan Mustafa was very influenced by mysticism.