In 1126 North China was overrun by the nomadic Juchen (Jin), and the Song capital at Kaifeng was taken. The former emperor Huizong, who had abdicated in 1125, together with his son, the Qinzong emperor (reigned 1125/26–27), was carried into captivity. Another son of Huizong, later known as the Gaozong emperor (reigned 1127–62), reestablished the dynasty in the south, hence its designation as the Nan (Southern) Song (1127–1279).

Retreating southward with Gaozong, Yue Fei assumed command of the Song forces. He prevented the advance of the Juchen by taking advantage of their difficulty in using their cavalry in hilly South China. Assuming the offensive, he was able to recover and secure some of the occupied territory in central China south of the Yangtze and Huai rivers.

However, his attempt to push north and recover all the lost Chinese territory was opposed by a peace party within the capital headed by the minister Qin Hui, who believed that further prosecution of the war would be too costly. Qin Hui’s faction proved more influential, Yue Fei was imprisoned in 1141 and executed early the next year, and a peace treaty was signed that relinquished the northern territory. Yue Fei became revered as a great national hero, and Qin Hui came to be viewed as a traitor. Since the beginning of the 20th century, Yue has been extolled as a champion of national resistance in the face of foreign domination.