I also found that the Japanese prime minister is also sometimes addressed as 'Shogun', and retired prime ministers are refered to as 'shadow shogun'.
Tokugawa Ieyasu seized power and established a government at Edo (now known as Tokyo) in 1600. He received the title sei-i taishōgun in 1603 after he forged a family tree to show he was of Minamoto descent. The Tokugawa shogunate lasted until 1867, when Tokugawa Yoshinobu resigned as shogun and abdicated his authority to Emperor Meiji.
During the Edo period effective power rested with the Tokugawa shogun, not the emperor in Kyoto, even though the former ostensibly owed his position to the latter. The shogun controlled foreign policy, the military and feudal patronage. The role of the emperor was ceremonial, similar to the position of the Japanese monarchy after the Second World War.
The title of shogun in Japan meant a military leader equivalent to general, and at various times in the first millennium shoguns held temporary power, but it became a symbol of military control over the county. The establishment of the shogunate (or bakufu) at the end of the twelfth century saw the beginning of samurai control of Japan for 700 years until the Meiji Restoration in the middle of the nineteenth century.