In 200 BC, the Han dynasty of China launched a military campaign into the territory, attempting to subjugate the Xiongnu. However the Xiongnu forces ambushed and encircled the Han Emperor Gaozu at Baideng for seven days. Emperor Gao was forced to submit to the Xiongnu, and a treaty was signed in 198 BC recognising all the territories to the north from the Great Wall should belong to the Xiongnu, while the territory to the south of the Great Wall should belong to the Han. In addition, China was obliged to marry princesses and pay annual tribute to the Xiongnu. This "marriage alliance" was far from peaceful, as Xiongnu raids into the fertile southern land never ceased. During the period of Emperor Wen, Xiongnu raids advanced into China Proper, ravaged and even besieged near its capital Chang'an. This continued for 70 years until the reign of Emperor Wu, whose massive counteroffensives devastated the Xiongnu and sent them towards the road of decline.