The Song (宋) dynasty was an imperial dynasty of China that ruled from 960 to 1279. The dynasty was founded by Emperor Taizu of Song, who usurped the throne of the Later Zhou dynasty and went on to conquer the rest of the Ten Kingdoms, ending the Five Dynasties and Ten Kingdoms period. The Song often came into conflict with the contemporaneous Liao, Western Xia and Jin dynasties in northern China. After retreating to southern China following attacks by the Jin dynasty, the Song was eventually conquered by the Mongol-led Yuan dynasty.