Ezo (蝦夷) people once inhabited the area now known as Yamagata. Yamagata and
Akita Prefecture were known as
Dewa Province until the
Heian Period (794–1185), the
Fujiwara (藤原) family ruled the area. Yamagata City flourished during the
Edo Period (1603–1867) due to its status as a castle town and post station, famous for beni (red
safflower dye used in the production of handspun silk). In 1689, the famous
Matsuo Bashō visited Yamagata during his five-month trip to the northern regions of Japan.