The Miao have a very long history. Their legends claim that they lived along the Yellow River and Yangtze River valleys as early as 5,000 years ago. Later they migrated to the forests and mountains of southwest China. There they mostly lived in Guizhou Province. Military attacks in the eighteenth and nineteenth centuries forced them into the nearby provinces of Guangxi, Hunan, Hubei, and Yunnan.