Who were the shoguns?
The word "shogun" is a title that was granted by the Emperor to the country's top military commander. During the Heian period (794-1185) the members of the military gradually became more powerful than the court officials, and eventually they took control of the whole government. In 1192, a military leader called Minamoto Yoritomo had the Emperor appoint him shogun; he set up his own capital in Kamakura, far to the east of the Emperor's capital in Kyoto, near present-day Tokyo. For almost 700 years after that, Japan was ruled mainly by a succession of shoguns, whose titles were usually passed on from father to son. Sometimes the shogun's family would become weak, and a rebel leader would seize power from them, after which he would be named shogun and would start a new ruling family.

The final shoguns were those of the Tokugawa clan, who came to power in 1600 and ruled until 1867. Tokugawa Ieyasu, the founder of the dynasty, built a new capital in Edo, the city that is now Tokyo. His grandson Iemitsu established a law in 1639 forbidding Japanese people to travel abroad or people from other countries to visit Japan. The shoguns also imposed a strict class system, with the samurai (warriors) at the top, followed by farmers, artisans, and merchants. Under the shoguns were lords with the title of daimyo, each of whom ruled a part of Japan. The Tokugawa shogunate remained in firm command of the government during their rule, unlike earlier shogun families whose power was weaker.

In 1867 the fifteenth Tokugawa shogun, Yoshinobu, was forced to give up his position and return his power to the Emperor's court. The Emperor moved from Kyoto to Edo the following year, and his government swept away most of the systems established by the shogunate.