prevent further Chinese attempts to restore the Lê dynasty. Nguyễn Huệ sent a ritually submissive request to the Qianlong Emperor under the name of Nguyễn Quang Bình (also referred to as Ruan Guangping). In 1789, the Qianlong Emperor agreed to re-establish the tributary relationship and enfeoff Nguyễn as the King of Annam on the condition that Nguyễn Huệ personally lead a special delegation to Beijing to celebrate the Qianlong Emperor's 80th birthday. For the Qianlong Emperor, the motivation for accepting the arrangement was to retain the Qing's supremacy and stabilize their southern border. Chinese and Vietnamese sources agreed that Nguyễn Huệ sent an imposter with a delegation to Beijing, where they were received with lavish imperial favors. The Qianlong Emperor approved the proposal and bestowed Nguyễn Huệ with the title An Nam quốc vương ("King of Annam"). The title indicated that Nguyễn Huệ was recognized as the legal ruler of Vietnam and Lê Chiêu Thống was no longer supported. War with Nguyễn Ánh and fall Nguyễn Huệ, now stylized as Quang Trung, was resentful; he trained his army, built large warships and waited for an opportunity to take revenge on Qing. He also provided refuge to anti-Manchu organizations such as the Tiandihui and the White Lotus. Infamous Chinese pirates, such as Chen Tien-pao (陳添保), Mo Kuan-fu (莫觀扶), Liang Wen-keng (梁文庚), Fan Wen-tsai (樊文才), Cheng Chi (鄭七) and Cheng I (鄭一) were granted official positions and/or noble ranks under the Tây Sơn empire. All attack plans had to be given up due to Nguyễn Huệ's sudden death. The attack never materialized by the time that Quang Trung died in 1792. After a 1782 massacre of ethnic Chinese settler was carried out by the Tây Sơn, the support of the Chinese shifted towards to the Nguyễn lords. After Quang Trung's death, his son Nguyễn Quang Toản was enthroned as Emperor Cảnh Thịnh at the age of ten. However, the real power was in the hands of his uncle Bui Dac Tuyen, who enacted a massive political purge. Many who served under Quang Trung were executed, while others became discouraged and left the regime, considerably weakening the Tây Sơn. This paved the way for Nguyễn Ánh to capture the entire country within 10 years, with the help of French military adventurers enlisted by French bishop Pigneau de Behaine. In 1800, Nguyễn Ánh occupied Quy Nhơn citadel. In 1801, he occupied Phú Xuân, forcing