After the Battle of Ngọc Hồi-Đống Đa, a Vietnamese Lê prince, Lê Duy Chỉ (黎維祗), fled to Tuyên Quang and Cao Bằng, to fight against Tây Sơn dynasty. Chỉ devised a plan to unite Vientiane and Muang Phuan in a revolt of Tây Sơn dynasty. In 1791, Vientiane was invaded by Tây Sơn dynasty, Nanthasen had to flee. Finally, he reached an accommodation with Tây Sơn dynasty.