Japan transitioned to rule by powerful military governors called shoguns starting in 1180 AD. The shoguns gained power after winning a civil war and were granted authority over military forces by the emperor, though the emperor remained the nominal head of government. Samurai were warriors who served noble families in exchange for land and were bound by a strict honor code. Under the shoguns, Japan experienced constant warfare between powerful lords and a period of centralized rule, while the economy grew as trade, agriculture, and crafts expanded.