In 1127, the Jin Dynasty (1115 – 1234) of northern China captured Kaifeng, the capital of the Northern Song Dynasty (960 - 1127), and ended that Dynasty. The Jin Dynasty felt that their numbers were too small to establish themselves in the Song territories, so they made Zhang Bangchang, a minister in the court of the Northern Song Dynasty, as the emperor of Chu, which was a temporary government of the Jin Dynasty in northern China. He was selected because he had always been an advocate of making peace with the Jin Dynasty. This enabled the Jin to withdraw their troops. With strong opposition from most former ministers, Zhang Bangchang abdicated by issuing an edict in the name of Empress Dowager Meng of the Northern Song Dynasty, acclaiming Zhao Gou, younger brother of Emperor Qingzong of the Northern Song Dynasty, as emperor. On May the first, 1127, Zhao Gou came to the throne formally in Lin'an (Hangzhou) as Emperor Gaozong. This began the Southern Song dynasty.
However, the Jin Dynasty again made a push to invade southern China in 1128 with the excuse that Zhang Bangchang had been deposed. Later, to consolidate the rule in the southern part of the Yellow River, the Jin Dynasty made Liu Yu, another minister of the Northern Song Dynasty, the emperor of the Qi which became known as the 'False Qi' in Chinese history. Emperor Gaozong sent his generals to resist the invaders. They successfully smashed the allied forces of the Jin Dynasty and the False Qi.
In 1138, Emperor Gaozong, decided that the Southern Song Dynasty should seek peace with the Jin Dynasty. He then took Prime Minster Qin Hui's advice to recognise the Jin Dynasty and pay tribute to it in exchange for retaining sovereignty over southeastern China.
After Emperor Gaozong, the Southern Song Dynasty and the Jin Dynasty developed in a relatively stable environment. Although the Jin Dynasty had launched several southward aggressions, most fell by the way. The Southern Song Dynasty also went on northern expeditions in the rule of Emperor Xiaozong, the second emperor of the Southern Song Dynasty, but they failed, too. Later, the Southern Song allied with the rising Mongolia to resist the Jin Dynasty together. In 1234, the allied forces captured Caizhou (now in Henan Province) of the Jin Dynasty. Emperor Aizong of the Jin Dynasty hanged himself, and the Jin Dynasty died with him.
After the defeat of the Jin Dynasty, the Southern Song Dynasty still didn't find peace. It now had to face a stronger enemy, from Mongolia. When withdrawing the army from the Jin lands, the Southern Song Dynasty attempted to reoccupy the land grabbed by the Mongolian army while fighting as their allies, but they failed because of their weak military forces. At the same time, what the Sothern Song Dynasty had done became the excuse for the Mongolian's southward invasion. In 1235, the Mongolian's first southward invasion was beaten back. Later, they launched other attacks, all of which ended in failure because of the strong resistance of the Sothern Song Dynasty's soldiers and people. In 1259, Mengge Kahn of the Mongolian army died. Hearing this, his younger brother, Kublai Kahn, who was fighting against the army of the Southern Song Dynasty in E'zhou (now in Wuhan City, Hubei Province), withdrew his army to seize the position of King of the Mongolian people at once. Jia Sidao, an official of the Southern Song Dynasty, didn't lead the army to chase the Mongolian enemies, but instead he sent people to negotiate a peace contract with them. As a result, Kublai Kahn led the Mongolian army to return to the north without any further fighting.
After returning to the north, Kublai Kahn ascended to the throne of the Mogolian people successfully. And then, he established the Yuan Dynasty in northern China in 1271. In the same year, he led his army to have 'Lin'an', the capital of the Southern Song Dynasty, occupied. Thereafter, Southern Song Dynasty ended and China was reunified again.