The Japanese government declined in the A.D. 800s because a number of weak emperors came to the throne. Powerful nobles than began to gain control of land. Nobles began collecting more taxes from the peasants working the land. Nobles formed private armies. The shogun commanded the emperor's military government. The mongols attacked Japan twice, but the attackers were defeated because of violent pacific storms smashed many of their ships.