In the first year of Jingdezhen (1004), Empress Dowager Liao Chengtian and Shengzong launched a large-scale war in the name of recovering the Guannan area occupied by Zhou Shizong. Urgent documents from northern counties arrived in Kaifeng several times a night, and Song Tingchao was greatly shocked. Zhenzong often boasted that if the Liao army attacked, he would personally lead the expedition, but at this time he was a little timid. If Wang Qin, the political governor, wanted to seek refuge in Jinling (now Nanjing, Jiangsu Province), Chen Yaocuo, deputy chief executive of the Privy Council, asked him to take shelter in Sichuan. Only Kou Zhun, the prime minister, was interested in asking Zhenzong to go on an expedition in person immediately to boost morale and repel the Liao army's attack. Although the true Sect agreed to personal expedition, it longed for peace. Before leaving, send, Liao and make peace. In November, I went north from Kaifeng, the capital, but I looked back all the way. I marched slowly, and I arrived in Weicheng (now southeast of Huaxian County) in less than 200 miles, trying to escape to Jinling in the south. Urged by Kou Zhun and Gao Qiong, an imperial envoy, he crossed the Yellow River in November and reached the northern part of Yuzhou (now Puyang, Henan). According to the records in Volume 58 of "Continuing the History as a Mirror", when the Emperor Zhenzong Huanglong Banner was inserted into the northern city, Song Jun cheered "dozens of miles, and the momentum was a hundred times".
Prior to this, the Liao army had entered the named state in Enemy at the Gates, and Little Talan was shot dead by Song Jun, and Dingzhou (now Dingxian County, Hebei Province), which was heavily stationed in the Song Dynasty, also posed a threat to the rear of the Liao army. At this time, the million-strong army in the Song Dynasty had arrived in Yizhou, and the Liao army felt that it was alone, making a taboo for military strategists and trying to find a way out. 1February, the two sides entered into an agreement, stipulating that the Song Dynasty would give the Liao Dynasty 200,000 silks and 102,000 silvers each year, which was called "ancient coins". The county name of Gezhou is Ge Yuan, so this covenant is called "Ge Yuan League". From then on, Song and Liao lived in peace until the end of the Northern Song Dynasty.