The Yarlung rulers of Tibet also signed various peace treaties with the Tang, culminating in a treaty in 821 that fixed the borders between Tibet and China.