Nominally, sovereignty lay in the emperor but in fact power was wielded by the Fujiwara nobility. However, to protect their interests in the provinces, the Fujiwara and other noble families required guards, police and soldiers. The warrior class made steady gains throughout the Heian period. As early as 939, Taira no Masakado threatened the authority of the central government, leading an uprising in the eastern province of Hitachi, and almost simultaneously, Fujiwara no Sumitomo rebelled in the west. Still, military takeover was centuries away, when much of the strength of the government would lie within the private armies of the shogunate.