Chinese history spans over 50,000 years, with key themes being China's identity as land, time, and people. Major dynasties that ruled China include the Shang Dynasty which established early Chinese writing and the Zhou Dynasty which saw the rise of Confucianism. The Qin Dynasty first unified China under centralized rule, while the Han Dynasty expanded China's territory and influenced many. Subsequent dynasties such as the Tang and Song saw periods of cultural and economic prosperity, though China also experienced foreign rule under the Mongols and Manchus. In modern times, China transitioned to a republic and communist government under the leadership of Mao Zedong and Deng Xiaoping.