The aboriginal Ezo (蝦夷) people once inhabited the area now known as Yamagata. Yamagata and Akita Prefecture were known as Dewa Province until the Meiji Restoration.
During 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 haiku poet, Matsuo Bashō visited Yamagata during his five-month trip to the northern regions of Japan.