The administration system of the Liao empire 遼 (907-1125) was a mixture of traditional social structures of the Khitan federation and adopted Chinese government institutions.
The traditional Khitan government was run from a more or less permanent biwak called ordo in Khitan (Chinese rendering woluduo 斡魯朵) from where the chieftain or khan commanded his troops, reigned his people and the slaves (Chinese rendering wali 瓦里; prisoners of war or delinquents). Under Emperor Liao Shengzong 遼聖宗 (r. 982-1030) most slaves were liberated and became ordinary free people. Free people of every origin that engaged as pasturers, farmers or warriors were subordinated to the Khitan nobility and their households were administered within a "subjection" (touxia 頭下 or 投下). Only the members of the imperial Yelü 耶律 family were allowed to construct fortifications for settlements. During the imperial hunting activities in different seasons the whole imperial court followed the Khitan khan (or the Liao emperor) to the hunting grounds, a custom that was called nabo 捺鉢 "ambulant government".
After the conquest of the Later Jin empire 後晉 (936-946) and the incorporation of many Chinese subjects into the Khitan realm Emperor Liao Taizong 遼太宗 (r. 927-947) installed a Chinese bureaucratic institution, the Bureau of Military Affairs (shumiyuan 樞密院), later a second "northern" bureau for the Khitans. This bureaus became the most important governmental institutions and did not only regulate military issues but also took part in all political matters. The posts of the military affairs commissioners (shumishi 樞密使) could be occupied by either Chinese or Khitans.
In the tradition of the Chinese government the ruler or emperor faced south, the highest officials at the court stood in two rows east and west. In the Khitan central government, the emperor faced east as the cardinal direction, the Khitan ministers waited in a row north and the Chinese in a row south of this direction. The highest ministerial title - later only honorific - was that of "yuyue" 于越, but in fact, the highest ministers were the military affairs commissioners whose posts were for a long time occupied by the descendants of the two princes Yelü Diela 耶律迭剌 and Yelü Yishi 耶律乙室,and the holders of these posts were given the title of Great Prince (dawang 大王). Other relatives of the emperor hold posts with the title of dangyin 愓隱, relatives of the empress the title of changgun 常袞 (Manager of the Khitan households), the Khitan civil ministers (linya 林牙) coordinated the flow of documents, the Chinese affairs were handled in a ministry called governmental court (zhengshisheng 政事省, later Palace Secretariat zhongshusheng 中書省), the language and composition of governmental documents was coordinated in a Chinese-style Hanlin Academy (hanlinyuan 翰林院). Under Emperor Shengzong, Chinese-style state examinations for the election of officials (keju kaoshi 科舉考試) were institutionalized, but only for Chinese officials.
The homeland of the Khitans in modern Heilongjiang province and eastern Mongolia was administered in the traditional Khitan style with free and enslaved people, the conquered territories of the Bohai empire 渤海 in modern Jilin province retained their political system, and the southern territories were administered in a Chinese-style bureaucracy with 36 prefectures (zhou 州) and subordinated counties (xian 縣). In the Khitan territory the tribal system was arranged in four groups, the northern and southern principal prefecture (dawangfu 大王府), the prefecture of the Yishi Prince 乙室王府, and the prefecture of the Prince of the Xi people (Xi wang fu 奚王府). These territories were later divided into 34 parts of different tribes under a military commissioner (jiedushi 節度使) that was normally identical with the tribal chieftain. Within the borders of the old Bohai empire the Princedom of Eastern Khitan (Dongdanguo 東丹國) was founded and governed by an imperial prince of the Yelü family who took over the administration structure of the Bohai rulers. But this Princedom was abolished soon and administered as zhongtaisheng 中台省 "intermediate department".
To coordinate all these different administratorial structures, several secondary capitals were established: the Central or "Upper" Capital (shangjing 上京) was Linhuang 臨潢,
later called Dadingfu 大定 (modern Kailu
開魯, Inner Mongolia), within the territory of the Xi people Dading 大定 (modern Chaoyang 朝陽, Liaoning) made "Central Capital" (zhongjing 中京), the old territory of Bohai was given the "Eastern Capital" (dongjing 東京) Liaoyang 遼陽, Liaoning, and the southern, Chinese part of the Khitan empire was administered from the "Southern Capital" (nanjing 南京) Xijin 析津 (modern Beijing). The Western Capital was Datong 大同, Shanxi.
Like for the territorial administration, the legal system was also different in the various regions of the Liao empire. While the Khitan part used the traditional Khitan law, the Bohai and Chinese parts of their empire were administered according to the Tang law. The most important revision of the Khitan law was the submission of the slaves to common law instead of delivering them to the goodwill of their master or owner. In cases where Chinese and
Khitanswere involved, both law traditions had to be considered. In 1036 a new official law codex was issued, the Chongxi tiaozhi 重熙條制, and in 1070 the Xianyong tiaozhi 咸雍條制, unfortunately nothing of these law codices is preserved. The central police agency of the Liao empire was the Court of Judicial Review dalisi 大理寺.
The empires of Liao and Jin 金 (1115-1234) followed this custom and even nominated their administrative units with five capitals.