In Japanese history, a shōgun (将軍) was the practical ruler of Japan for most of the time from the establishment of the Kamakura shogunate to the dissolution of the Tokugawa shogunate (1192–1868).