The Qing dynasty (1644–1912) established their rule over Tibet after a Qing expedition force defeated the Dzungars in 1720, and lasted until the fall of the Qing dynasty in 1912. The Qing emperors appointed imperial residents known as the Ambans to Tibet, who commanded over 2,000 troops stationed in Lhasa and reported to the Lifan Yuan, a Qing government agency that oversaw the region during this period. The rulers of the Manchu Qing dynasty supported Tibetan Buddhism, especially the Gelug sect, for most of their dynasty.