The Song Dynasty ruled China from 960 to 1279 CE and was divided into two periods - the Northern Song and Southern Song. The Northern Song ruled most of northern China from 960-1127 CE with its capital in Kaifeng. It collapsed after losing control of northern China to the Jin Dynasty in 1127 CE. The Southern Song ruled southern China from 1127-1279 CE with its capital in Hangzhou. Despite losing territory, the Southern Song was a period of cultural and economic prosperity, with advances in art, literature, technology, and a commercialized economy.