Shōgun was the title of leading samurai. While the Japanese emperor (Tennō) officially ruled Japan, the Shōgun held all of its military power. The title was hereditary and the Shōgun could be seen as dictator.
The government beneath the shōgun was called the bakufu.