The Bureau of Buddhist and Tibetan Affairs, or Xuanzheng Yuan (Chinese: 宣政院; pinyin: Xuānzhèngyuàn; literally: "Court for the Spread of Governance") was a government agency and top-level administrative department set up in Khanbaliq (modern Beijing) that supervised Buddhist monks in addition to managing the territory of Tibet during the Yuan dynasty (1271-1368) established by Kublai Khan. It was originally set up in 1264 as an autonomous office named Zongzhi Yuan (simplified Chinese: 总制院; traditional Chinese: 總制院; pinyin: Zǒngzhìyuàn) or the Bureau of General Regulation, before it was renamed in 1288, which was named after the Xuanzheng Hall where Tibetan envoys were received in the Tang dynasty. In the Mongol Empire, Tibet was managed by the Bureau of Buddhist and Tibetan Affairs, separate from the other provinces of the Yuan dynasty such as those governed the former Song dynasty of China, but still under the administrative rule of the Yuan. While no modern equivalents remain, the political functions of the Bureau of Buddhist and Tibetan Affairs might have been analogous to the India Office in London during the British Raj. Besides holding the title of Imperial Preceptor or Dishi, Drogön Chögyal Phagpa, the fifth leader of the Sakya school of Tibetan Buddhism, was concurrently named the director of the Bureau of Buddhist and Tibetan Affairs. One of the department's purposes was to select a dpon-chen ('great administrator', a civilian administrator who governed Tibet when Sakya Lama was away), usually appointed by the lama and confirmed by the Mongol emperor in Beijing. Tibetan Buddhism was not only practiced within the capital Beijing but throughout the country. Apart from Tibetan affairs, the Bureau of Buddhist and Tibetan Affairs managed the entire Buddhist clergy throughout the realm (whether they were Han Chinese, Tibetan or Korean etc.), and supervised all temples, monasteries, and other Buddhist properties in the empire, at least in name. According to scholar Evelyn Rawski, it supervised 360 Buddhist monasteries. To emphasize its importance for Hangzhou, capital of the former Southern Song dynasty and the largest city in the Yuan realm, a branch (行, Xing, "acting") Xuanzheng Yuan was established in that city in 1291, although Tibetan Buddhism took public or official precedence over Han Chinese Buddhism.
The Lifan Yuan (also known as the Board for the Administration of Outlying Regions and Office of Mongolian and Tibetan Affairs etc.) established by the Manchus was roughly a Qing dynasty version of Xuanzheng Yuan, instituted by the Yuan state for administering affairs beyond the borders of China proper.