China emerged as one of the world's first civilizations, in the fertile basin of the Yellow River in the North China Plain. China was one of the world's foremost economic powers for most of the two millennia from the 1st until the 19th century. For millennia, China's political system was based on absolute hereditary monarchies, or dynasties, beginning with the Xia dynasty in 21st century BCE. Since then, China has expanded, fractured, and re-unified numerous times. In the 3rd century BCE, the Qin reunited core China and established the first Chinese empire. The succeeding Han dynasty (206 BCE–220 CE) saw some of the most advanced technology at that time, including papermaking and the compass, along with agricultural and medical improvements. The invention of gunpowder and movable type in the Tang dynasty (618–907) and Northern Song Dynasty (960–1127) completed the Four Great Inventions. Tang culture spread widely in Asia, as the new Silk Route brought traders to as far as Mesopotamia and the Horn of Africa. The Qing Empire, China's last dynasty, which formed the territorial basis for modern China, suffered heavy losses to foreign imperialism. The Chinese monarchy collapsed in 1912 with the 1911 Revolution, when the Republic of China (ROC) replaced the Qing dynasty. China was invaded by the Empire of Japan during World War II. The Chinese Civil War resulted in a division of territory in 1949 when the Chinese Communist Party (CCP) led by Mao Zedong established the People's Republic of China on mainland China while the Kuomintang-led ROC government retreated to the island of Taiwan. Both the PRC and the ROC currently claim to be the sole legitimate government of China, resulting in an ongoing dispute even after the United Nations recognized the PRC as the government to represent China at all UN conferences in 1971. China is currently governed as a unitary one-party socialist republic by the Chinese Communist Party.