....When he died in 1682, the Tibetan government encountered succession problems: the hastily-enthroned sixth Dalai Lama was noted for his 'unbridled licentiousness'. At the same time, relations with the new Chinese Manchu Qing Dynasty quickly soured and in 1705 Mongol forces descended on Lhasa, capturing the Dalai Lama. The choice of his successor was just as controversial. He was deposed during the invasion of a rival group of Mongols in 1717, who were ousted in turn by the Chinese, who brought the seventh Dalai Lama with them. The Chinese were received as liberators by the Tibetans, and Emperor Kang Xi declared Tibet a protectorate of China - a historical precedent for the Communist takeover nearly 250 years later.