China was a monarchy from prehistoric times up to 1912 CE, when the Xinhai Revolution overthrew the Qing dynasty in favor of the Republic of China. The succession of mythological monarchs of China were non-hereditary. Dynastic rule began in circa 2070 BCE when Yu the Great established the Xia dynasty, and lasted until 1912 CE when dynastic rule collapsed together with the monarchical system.