In ancient China, nomadic and farming groups had different lifestyles, reflecting differences in living conditions. Changes in regional agriculture and animal husbandry productivity due to climate changes led to either wars or peace between nomadic and farming groups. A war sequence of farming and nomadic groups in north China from Western Han Dynasty to Qing Dynasty (206BC-1911AD) was reconstructed, and relationship between national war and climate change was analyzed. There were 832 wars between the two groups from Western Han Dynasty to Qing Dynasty. The average was 3.9 times per 10a. High incidence of war occurred in Eastern Han Dynasty, Song Dynasty, Yuan Dynasty, Ming Dynasty, Qing Dynasty. Low incidence of war occurred in Western Han Dynasty, Three Kingdoms, Wei and Jin Dynasties, and Northern and Southern Dynasties, Sui and Tang Dynasties, Five Dynasties. On a 100-year-period timescale and a 30-year-period timescale, warm climates corresponded to high incidence of war, and cold climates corresponded to low incidence of war. The nomadic people initiated 71.3% of wars, but 61.1% were won by the farmers. Compared with warm period, proportion of farming people initiating wars in cold period increased, but proportion of victories was reduced. Climate change plays an indirect role in wars between the two groups. In cold period, strength of both groups weakened, and concessions were made lowering war frequency. In warm period, nomadic group initiated wars many times possibly due to insufficient means of livelihood after population expansion and expanded social structural requirements when nomadic group was strong. Further, warm climate provided a solid material foundation for nomadic and farming groups, especially contributed to improve productivity of nomadic group. War plunders with low cost and high yield also induced war occurrence between farming and nomadic groups.