History of the Song dynasty
Frontier policy and war

As a result, Thường Kiệt made peace overtures to the Song; the Song commander Guo Kui agreed to withdraw his troops, but kept five disputed regions of Quảng Nguyên (renamed Shun'anzhou or Thuận Châu), Tư Lang Châu, Môn Châu, Tô Mậu Châu, and Quảng Lăng. These areas now comprise most of modern Vietnam's Cao Bằng Province and Lạng Sơn Province. In 1082, after a long period of mutual isolation, King Lý Nhân Tông of Đại Việt returned Yong, Qin, and Lian prefectures back to Song authorities, along with their prisoners of war, and in return Song relinquished its control of four prefectures and the county of Đại Việt, including the Nùng clan's home of Quảng Nguyên. Further negotiations took place from 6 July to 8 August 1084 and were held at Song's Yongping garrison in southern Guangnan, where Vietnamese Director of Military Personnel Lê Văn Thịnh (fl. 1075–1096) convinced Song to fix the two countries' borders between Quảng Nguyên and Guihua prefectures.
detectable_content:postscript