In 1004, the Liao dynasty carried out a large-scale invasion of Song territory, camping out in the town of Shanyuan, about 100 miles north of the Song capital of Kaifeng. This resulted in the Treaty of Shanyuan, signed in mid-January 1005. According to this treaty, the Song dynasty would pay an annual tribute of 200,000 bolts of silk and 100,000 taels of silver to the Liao dynasty in exchange for peace. This arrangement would remain in place with modifications until the end of the Liao dynasty, and in fact, the Jurchens could continue this arrangement with the Song dynasty with the founding of their Jin dynasty.