Shanxi, the territory of state of Jin during the Spring and Autumn Period (722 BC - 403 BC), underwent a three-way split into the states of Han, Zhao and Wei in 403 BC, the traditional date taken as the start of the Warring States Period (403 BC - 221 BC). By 221 BC all of these states had fallen to the state of Qin, which established the Qin Dynasty (221 BC - 206 BC).
The Han Dynasty (206 BC - AD 220) ruled Shanxi as the province (zhou) of Bingzhou (?? B?ng Zh?u). During the invasion of northern nomads during the Sixteen Kingdoms period (304 - 439), several regimes including Later Zhao, Former Yan, Former Qin, and Later Yan continuously controlled what is now Shanxi. They were followed by Northern Wei (386 - 534), a Xianbei kingdom, which had one of its earlier capitals at present-day Datong in northern Shanxi, and which went on to rule nearly all of northern China.
The Tang Dynasty (618 - 907) originated in Taiyuan, Shanxi Province. Modern Chinese people are called Tang Ren globally due to the power and impact of the Tang Dynasty in history. During the Tang Dynasty and after, the area was called Héd?ng (??), or "east of the (Yellow) river". Empress Wu Zetian, China's only female ruler, was born in Shanxi Provernce
During the first part of the Five Dynasties and Ten Kingdoms Period (907 - 960), Shanxi supplied rule for three of the Five Dynasties, as well as being the only one of the Ten Kingdoms located in northern China. Shanxi was initially home to the jiedushi (commander) of Hedong, Li Cunxu, who overthrew the first of the Five Dynasties, Later Liang Dynasty (907 - 923) to establish the second, Later Tang Dynasty (923 - 936). Another jiedushi of Hedong, Shi Jingtang, overthrew Later Tang to establish the third of the Five Dynasties, Later Jin Dynasty, and yet another jiedushi of Hedong, Liu Zhiyuan, established the fourth of the Five Dynasties (Later Han Dynasty) after the Khitans destroyed Later Jin, the third. Finally, when the fifth of the Five Dynasties (Later Zhou Dynasty) emerged, the jiedushi of Hedong at the time, Liu Chong, rebelled and established an independent state called Northern Han, one of the Ten Kingdoms, in what is now northern and central Shanxi.
Shi Jingtang, founder of the Later Jin Dynasty, the third of the Five Dynasties, ceded a large slice of northern China to the Khitans in return for military assistance. This territory, called The Sixteen Prefectures of Yanyun, included a part of northern Shanxi. The ceded territory became a major problem for China's defense against the Khitans for the next 100 years, because it lies to the south of the Great Wall.
During the Northern Song Dynasty (960 - 1127), the sixteen ceded prefectures continued to be an area of contention between Song China and the Liao Dynasty. Later the Southern Song Dynasty abandoned all of North China to the Jurchen Jin Dynasty (1115-1234) in 1127, including Shanxi.
The Mongol Yuan Dynasty divided China into provinces but did not establish Shanxi as a province. Shanxi only gained its present name and approximate borders in the Ming Dynasty (1368–1644). During the Qing Dynasty (1644–1911), Shanxi extended northwards beyond the Great Wall to include parts of Inner Mongolia, including what is now the city of Hohhot, and overlapped with the jurisdiction of the Eight Banners and the Guihua Tümed banner in that area.
During most of the Republic of China's period of rule over mainland China (1912–1949), the warlord Yen Hsi-shan held Shanxi, regardless of the frequent political upheavals shaking the rest of China. During the Second Sino-Japanese War, Japan occupied much of the province after defeating China in the Battle of Taiyuan. Shanxi was also a major battlefield between the Japanese and the Chinese communist guerrillas of the Eighth Route Army during the war.
After the defeat of Japan, much of the Shanxi countryside became important bases for the communist People's Liberation Army in the ensuing Chinese Civil War. Yen had incorporated thousands of former Japanese soldiers among his own forces, and these soldiers became part of his failed defense of Taiyuan against the People's Liberation Army in early 1949.
For centuries Shanxi served as the center of trade and banking, with the term "Shanxi Merchant" (?? jìnsh?ng) once synonymous with wealth. The well-preserved city of Pingyao in Shanxi also shows many signs of its former dominance as a center of trade and banking. Due to Shanxi's geographic location in the Great China and its natural environment, Shanxi was the richest province in Zhongyuan or Center China. In the Qing Dynasty, Pingyao served as the centre of Chinese banking industry. This county, in contemporary time, is famous for its UNESCO ancient city walls and ancient China's Wall Street for its financial importance in history. In modern times, coal mining is important in Shanxi's economy, but severe critics have complained of deplorable mine conditions. Since 2004 the province has been plagued with labour safety issues, including a slave labour scandal involving children, causing significant civil unrest and national embarrassment.