The Song dynasty was a ruling dynasty in China between 959–1276 AD; it succeeded the Five Dynasties and Ten Kingdoms period, and was followed by the Yuan dynasty. It was the first government in world history to issue banknotes or paper money, and the first Chinese government to establish a permanent standing navy. The Song dynasty is divided into two distinct periods: the Northern Song and Southern Song. During the Northern Song, the Song capital was in the northern city of Bianjing and the dynasty controlled most of inner China. The Southern Song refers to the period after the Song lost control of northern China to the Jin dynasty. During this time, the Song court retreated south of the Yangtze river and established their capital at Lin'an. The Southern Song Dynasty considerably bolstered naval strength to defend its waters and land borders and to conduct maritime missions abroad. To repel the Jin (and later the Mongols), the Song developed revolutionary new military technology augmented by the use of gunpowder. In 1234, the Jin dynasty was conquered by the Mongols, who took control of northern China, maintaining uneasy relations with the Southern Song. After two decades of sporadic warfare, Kublai Khan's armies conquered the Song dynasty in 1279. China was once again unified, under the Yuan dynasty.