The Song dynasty (/sʊŋ/ SUUNG) 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.
The dynasty's history is divided into two periods: during the Northern Song (北宋; 960–1127), the capital was in the northern city of Bianjing (now Kaifeng) and the dynasty controlled most of what is now East China. The Southern Song (南宋; 1127–1279) comprised the period following the loss of control over the northern half of Song territory to the Jurchen-led Jin dynasty in the Jin–Song wars. At that time, the Song court retreated south of the Yangtze and established its capital at Lin'an (now Hangzhou). Although the Song dynasty had lost control of the traditional Chinese heartlands around the Yellow River, the Southern Song Empire contained a large population and productive agricultural land, sustaining a robust economy. In 1234, the Jin dynasty was conquered by the Mongols, who took control of northern China, maintaining uneasy relations with the Southern Song. Möngke Khan, the fourth Great Khan of the Mongol Empire, died in 1259 while besieging the mountain castle Diaoyucheng in Chongqing. His younger brother Kublai Khan was proclaimed the new Great Khan and in 1271 founded the Yuan dynasty. After two decades of sporadic warfare, Kublai Khan's armies conquered the Song dynasty in 1279 after defeating the Southern Song in the Battle of Yamen, and reunited China under the Yuan dynasty.