The Lifanyuan 理藩院 "Court of Colonial Affairs" (Manchu name tulergi golo be dasara jurgan) was the central government agency responsible for the relations with Mongols, Muslims, Tibetans, Russia, and other ethnic groups living in the area controlled by the Qing dynasty 清 (1644-1911). It was the precursor of a kind of Ministry of Foreign Affairs that came into being with the foundation of the Foreign Office (zongli yamen 總理衙門).
The Court of Colonial Affairs was not located in a specified office. In 1636 the Manchu ruler Hong Taiji 皇太極 (r. 1626-1643) founded the Mongol Office (Menggu yamen 蒙古衙門) that was lead by an executive minister (chengzheng 承政) and an executive vice minister (canzheng 參政). In 1639 this office was renamed lifanyuan and made an institutions under the Ministry of Rites (libu 禮部). From 1644 on it was headed by a minister (shangshu 尚書) and a vice minister (shilang 侍郎). Eighteen years later its minister was elevated to the same level as the heads of the Six Ministries (liubu 六部) and was allowed to take part in political deliberations with the emperor. At the same time, four sections were founded, the Honours Bureau (luxunsi 錄勳司), Receptions Bureau (binkesi 賓客司), Outer Mongolian Receptions Bureau (rouyuansi 柔遠司) and Judicial Bureau (lixingsi 理刑司). The Kangxi emperor 康熙 (r. 1661-1722) ordered that the post of minister of the Court of Colonial Affairs be occupied by a high noble of the rank of King (wang 王) of Duke (gong 公) or by a Grand Secretary (daxueshi 大學士). During the Qianlong reign 乾隆 (1736-1795) the sections were reorganised into the Inner Mongolian Bureau (qijisi 旗籍司), the Inner Mongolian Reception Bureau (wanghuisi) 王會司, Outer Mongolian Bureau (dianshusi 典屬司), Outer Mongolian Reception Bureau, Eastern Turkestan Bureau (laiyuansi 徠遠司) and Judicial Bureau. In 1907 the Court was made a ministry as lifanbu 理藩部.
The Court of Colonial Affairs was the institution with the help of which the Qing court administered the peoples in the regions it had occupied, like Tibet, Xinjiang 新疆 or Mongolia. These regions were not transformed into regular provinces (sheng 省) but were subject to a special kind of relationship in which the local chieftains and leaders were appointed native officials for the Qing empire. The administrative procedures were fixed in 1697 with the promulgations of the Lifanyuan zeli 理藩院則例 "precedents of the Court of Colonial Affairs".
The Court of Colonial Affairs administered the ennoblement of natives, their tributes, border disputes, officials, military and justice, household registers, taxes, economy, courier stations, trade and religion. The Court of Colonial Affairs possessed several agencies that were entrusted with the daily business, like the General Services Office or Chancery (siwuting 司務廳), the Silver Vault (yinku 銀庫), the Meal Allowance Office (fanyinchu 飯銀處), the Seal and Record Office (dangyuechu 當月處), the Incitement Office (ducuisuo 督催所) and the archives (dangfang 檔房), whose documents were divided into Manchu, Chinese and Mongol documents.
The Manchu Archive (Man dangfang 滿檔房) was also a Registration and Registry Office, the Chinese Archive (Han dangfang 漢檔房) a Translation Office, and a third archive served as a Treasury for the Official Salaries (fengdangfang 俸檔房). There were also the Inner Hostel (neiguan 内館) and the Outer Hostel (waiguan 外館) maintained for Mongol princes, a Mongolian School (Menggu xue 蒙古學), a Tibetan School (Tanggute xue 唐古特學), a Tangutan School (Tuote xue 托忒學), a Russian School (Eluosi xue 俄羅斯學), an office for the administration of the Imperial Summer Resort (mulan weichang 木蘭圍場), the Lama Office (lama yinwusuo 喇嘛印務所) and the Precedents Bureau (zeliguan 則例館). High secretaries (siyuan 司員) of the Court were regularly sent to take residence for some time in the administered regions.