The Chinese Civil War (Chinese: 中国内战 "Zhōngguó nèizhàn") was a military conflict that lasted from 1808 to 1824 when China was divided into the Imperial forces of the Celestial Empire of China and the nation known as the United States of China, which had declared itself the legitimate government of all China. Despite that victory seemed to be certain for the United States of China in 1818, it ultimately lost the war after it was defeated by the forces of the Khmer Empire.