North of Dai: Armed Communities and Military Resources in Late Medieval China (880-936)

This article discusses various aspects of the formation of the Shatuo as a complex constitutional process from armed mercenary community to state founders in the waning years of Tang rule and the early tenth century period (880-936). The work focuses on the territorial, economic, and military aspects of the process, such as the strategies to secure control over resources and the constitution of elite privileges through symbolic kinship ties. Even as the region north of the Yanmen Pass (Daibei) remained an important pool of recruits for the Shatuo well into the tenth century, the Shatuo leaders struggled to secure control of their core manpower, progressively moving away from their military base of support, or losing it to their competitors.


Introduction
For most of the second half of the ninth and early tenth century, the borderland north of the Yanmen Pass 雁門 known as Daibei 代 北 ('north of Dai', present-day Inner Mongolia and northern Shanxi), was dominated by armed communities that depended on the Tang 唐 (618-907) military system and rose through its ranks. The core of these groups were heterogeneous migrant military forces, mostly of Central Asian extraction, that had settled in Daibei at the turn of the ninth century and came to compete for control over the military resources and transportation routes of the sparsely populated northern border zone. The weakness and corruption endemic to the Tang military and administrative system exacerbated this competition and favoured the Shatuo 沙陀 leadership's growth into a territorially rooted power, successful enough to aspire to founding a state. 1 This paper discusses some of the constitutional aspects of this growth, with a focus on the events that followed a major military mutiny at the border in 878 intended to gain control of the transportation of goods to the northern garrisons. Amid the unrest, the Shatuo leader Li Keyong 李克用 (856-908) emerged as an authoritative commander, and his military retinue expanded into a new and larger army. I describe in detail the events leading to the unrest in another article (2020). In the present work I limit myself to discussing the consequences that unfolded in the aftermath of the unrest, leading to the growth of an enlarged and heterogeneous client army under the leadership of Li Keyong. This powerful new armed community identified as Shatuo after its chief commander. The term Shatuo has long been treated as a fully-fledged ethnic term designating a Turkic group characterised by defined biological and cultural ties. While the leading members of the Shatuo were identified as being Turkic, a considerable part of the group consisted in a highly heterogeneous elements from different Inner Asian extraction. Moving beyond the traditional definition, in the research work that I am currently carrying out I seek alternatives that can account for the social, economic, and political dynamics of group formation, and I argue that the term Shatuo might have functioned as reward for service for meritorious military men. 2 This article is part of a broader research project that will result in a monographic study on the formation of the Shatuo from mercenaries to state founders as a constitutional process, and on the more general process of social mobility and identity formation in military communities throughout the Tang-Song transition. The project is financially supported by a two-year starting grant awarded by Ca' Foscari University. The theoretical framework is inspired by Herwig Wolfram's notion of the formation of medieval European migrant "people in arms" as a constitutional process that "meant pri-In the aftermath of the 878-border unrest, Li Keyong's growing authority intensified a competition with Sogdian and Tuyuhun 吐谷渾 military leaders. 3 The latter both enjoyed only weak support from the Tang court and found stronger patrons in the governors of the eastern provinces. This paper argues that even though the region north of the Yanmen Pass remained an important reservoir of recruits and military support for Li Keyong and the Shatuo regimes well into the tenth century, 4 the Shatuo leaders struggled to secure control of their core armed followers, progressively alienating their military base of support, or losing it to their competitors. When the Khitan (Qidan 契丹) emerged on the political stage, the Shatuo's stronger competitors from the northeast, and Li Keyong's rival Yelü Abaoji 耶律阿保機 (posthumously known as Taizu 太祖, r. 907-926) proved his authority through success in battle, many of the border soldiers who followed Li Keyong were lured away by the prospect of greater reward. The newly established Khitan-led Liao empire 遼 (907-1125) would go on to take possession not only of manpower, but also of land and entire administrative units, 5 taking hold of the territory north of the Yanmen Pass and transforming it into a metropolitan region of the new empire that will become the Western Capital 西京 (Datong 大同) in the mid-eleventh century. The Liao can be said to have succeeded where the Shatuo leaders failed: in transforming armed communities into an integrated part of a new bureaucratic state.
In the eleventh century, the loss of northern Hebei and the land north of the Yanmen Pass to the Liao became the subject of heated debates among Song policymakers, as well as the cause of several military and diplomatic disputes between the Song and the Liao courts over the definition of the border line. 6 To the Song, the lost land also became a symbol of the Shatuo rulers' wrongdoing and weaknesses, the latter tendentially intrinsic to their 'barbarian' origins. This standpoint reflects the political culture of the eleventh century, but it tells us little about the real historical context of the events. This article endeavour to shed some light upon less studied aspects of the history of this region and of its military community in the late ninth and first decades of the tenth century. For centuries, the territory north of the Yanmen Pass had constituted a borderland between the Chinese central provinces and the nomadic polities of the steppe belt, characterised by a weak imperial presence and fluid alliances among heterogeneous groups in power. The Sanggan River 桑乾河 basin, delimited to the south by the Hengshan mountain range 橫山, had seen the growth of important urban centres over the centuries, first and foremost the capital of the Northern Wei 北魏 (386-534) dynasty, Pingcheng 平城. 7 North of Pingcheng, the Wei built a defensive line of garrisons (beizhen 北鎮) that extended from present-day Bayannur city in Inner Mongolia to present-day Zhangbei prefecture in Hebei. 8 In the late fourth century, the Northern Wei forcibly settled half a million people in the new capital and the surrounding garrisons, including a large number of seminomadic people from the western frontiers and the steppe region. Members of this seminomadic group were called 'new commoners' (xinmin 新 民) 9 and were likely to be subject to some form of levy. Local authorities struggled to control their movements and to limit their seasonal migration to the pastures beyond the desert. Indeed, the relationship between the local officials and the new settlers was far from peaceful, and on several occasions armed groups rebelled against the Tabghach (Tuoba 拓跋) authority, only to be separated from their fellows and relocated to other provinces as a punishment (Barenghi 2018, 30 ff.). After the capital was moved further south to Luoyang 洛陽 in 493, the garrisons became dominated by armed groups of heterogeneous extraction formed of Tabghach leaders, local officials, convicts and Central Asian chieftains. 10 A series of mutinies and military rebellions, most notably the rebellion of 523, enlarged the numbers in these military groups and eventually caused the Tabghach empire to split into two short-lived regimes, the Eastern Wei 東魏 (534-550) and . 11 From the end of the sixth through the beginning of the seventh century, the region of Daibei formed a frontier buffer zone between the First Türk Empire (552-630) and the short-lived northern regime of the Northern Qi 北齊 (550-577). Fluid allegiances and short-lived patronage relations characterised the area during this time (Dien 2019).
The Sui 隋 (581-618) rulers continued the Northern Wei practice of building walled towns for seminomadic settlers, in this case for Turkic settlers (Skaff 2004, 117-53;Suishu 1973Suishu , 84.1873. About three hundred li north of Shuozhou 朔州, northeast of the Yellow River northern loop in what was then Dingxiang commandery 定襄郡, 12 the Sui court built the fortified cities of Dali 大利 and Jinhe 金河 for the Türks (ZZTJ 179.5572;Skaff 2004, 122). Several Sui officials sought the support of the Eastern Türks between 618 and 631 and were rewarded with the title of qaghan. It was indeed not unusual, as in the case of the local leader Liu Wuzhou 劉武周 (d. 620?), to claim both the position of Sui official and the title of qaghan (Drompp 2007, 189). Three years later, Chuluo 處羅 Qaghan (r. 619-20) installed in Dingxiang an heir to the Sui throne, Yang Zhengdao 楊政道, as Prince of Sui. With a retinue of several hundred thousand of armed men, Yang established an independent albeit short-lived government. 13 9 Weishu 4.75.
10 For a look at the composition of these frontier gangs see the biography of Gao Huan 高歡 (496-547) in Bei Qi shu, 1.2; see also Dien 2019. 11 Pearce 2019Dien 1990. 12 The Dingxiang prefectural seat was subsequently moved farther south and renamed Yunzhong 雲中, while a Dingxiang county was created farther south, in Xinzhou 忻州 (Zizhi tongjian [1956], hereafter ZZTJ 193.6073). Several permanent military garrisons were established in Daibei well into the Tang period, following the decay of the 'regimental headquarters' (fu bing 府兵) system of universal military service (Graff 2002, 189; see also Lewis 2009, 44 ff.) and its gradual replacement by regular standing armies (Twitchett 1963, 84 ff.;Graff 2002, 210 ff.). Long-term professional stationary troops were lured by the prospect of a series of advantages including high wages, exemption from tax, housing for their entourage, and allocations of arable land (Graff 2002, 205 ff.). Beginning in the Kaiyuan era 開元 (713-741), the garrisons fell under the supervision of a regional military governor who had his administrative headquarters in Taiyuan 太原 (renamed Beidu 北都 'northern capital' during Empress Wu Zetian's reign). 14 The governor had direct command over all the military jurisdictions and garrisons that stood in Hedong 河東, and according to the official figures controlled one of the largest armies in the Tang empire (Graff 2002, 210 ff.).
Daibei became impoverished and scarcely populated in the aftermath of the An Lushan 安祿山 rebellion (755-763). Complete population figures for the three prefectures of Daibei, Yunzhou 雲州, Yuzhou 蔚州 and Shuozhou, date back to the census of 742, and no updated data are available for the ninth century; however, scattered references in the sources hint that the population decreased dramatically, a trend common to all of Northern China (see von Glahn 2015Glahn , 2010. In the Tianbao 天寶 era (742-756), the two counties of Shuozhou, Mayi 馬邑 and Shanyang 鄯陽, had boasted a combined population of slightly over twenty thousand people; 15 Shanyang was located about eighty li west of Mount Juzhu 句注. Some thirty li east of Shanyang county and 30 li west of the Sanggan River stood the fortifications of the Datong garrison 大同軍, the largest military garrison in northern Hedong; the county seat of Mayi was located inside the fortified city. 16 In the years 780 and 781, the military governor of Hezhong 河 中, general Ma Sui 馬燧 (726-795), forced the Shuozhou prefectural seat to be moved to Mayi. In the census of 742 Mayi had registered more than six thousand households, whereas in the first two decades of the ninth century Mayi registered roughly seven hundred. 17 Also known by its old name, Xingtang 興唐, Yuzhou was a prefectural seat situated south of the Sanggan River watershed and north-east of Yanmen Pass. 18 The New History of the Tang Dynasty (Xin Tang shu 新唐書, comp. 1060) reports that in 742 some thirty thousand people inhabited the three Yuzhou counties of Lingqiu 靈丘, Xingtang 興唐, and Feihu 飛狐. Several military garrisons surrounded Yuzhou: the Hengye garrison 橫野軍 to the northeast was moved to the Tiancheng garrison 天成軍in 758. 19 As for Yunzhou, it became a prefectural seat sometime in the first half of the Tang dynasty. Yunzhou stood on the old site of Pingcheng, the old capital of the Northern Wei. The Northern Wei and their successors the Northern Qi built segments of wall north of Pingcheng and fortifications all around the area. Wall remains were still visible in the late Tang period and were likely useful as territorial markers and defences. 20 The Turkic occupation caused Yunzhou to be abandoned as a prefectural seat for a time, its population forcibly moved to Shuozhou until the seat was restored in the Kaiyuan era. 21 The Shatuo military units were not the first or only Central Asian military group to relocate from Guanzhong 關中 and the Hexi 河西 region to Daibei. By the end of the eighth century, migrant military groups agreed to resettlement that included prospects of finding employment as auxiliary units in the Tang provincial garrisons. According to the Old History of the Tang Dynasty ( Jiu Tang shu 舊唐書, comp. 945), units of Tibetan armed men that had helped the court to suppress Zhu Ci's 朱泚military rebellion (783-784) on the western frontier invaded the territories of Ling-Yan 靈鹽 in retaliation because they had not received the expected rewards for their military services. 22 Pressed by the Tibetan incursions, several Turkic (Qibi 契苾), Sogdian and Tuyuhun migrant military groups resettled in Daibei. 23 Most of the groups resettled in the region of the upper Sanggan River, southwest of Yunzhou and north of Shuozhou. Around 809 the newly established military governor of Hedong, Fan Xichao 范希朝 (d. 814), resettled groups of Shatuo from the fortifications in Yanzhou 鹽 州, south of the Ordos, into the upper Sanggan River basin. Shatuo mercenaries had a reputation as fierce but somewhat unreliable, warriors: initially recruited into Tang expeditionary troops against the rebellious An Lushan, they subsequently joined the Tibetan troops on the western frontier for a short period of time before being lured 18 JTS 39.1007. back into the Tang military. Fan Xichao selected the finest horsemen among them to create a Shatuo garrison on the upper Sanggan River. He also allocated settlement land north of Shuozhou for the rest of the Shatuo followers (Barenghi 2020).
The new settlers came to constitute a ready source of military recruits for the provincial armies and border garrisons in a period of a general shortage of manpower and a sparsely populated region where revenue collection yielded little. Units of armed men who had settled on Tang soil were broken up into small groups and recruited as auxiliary troops of the several provincial armies and garrisons. Units of Tuyuhun and Qibi are mentioned alongside the Shatuo units, to whose commander the former were probably subordinated. 24 Indeed, beginning in the 830s the Shatuo leaders came to exercise a certain degree of control over the Sogdian settlements on behalf of the Tang court, and plausibly over all of the Central Asian armed communities resettled in the region. When Zhuxie Zhiyi 朱邪執宜 (d. ca. 830s?) was appointed as commander of the Daibei expeditionary troops 代北行 營招撫使, this Shatuo leader commanded a rather small but very efficient expeditionary troop of three thousand soldiers (Moribe 2005, 243-54;Barenghi 2020).
In the late sixties of the ninth century, the Daibei expeditionary army composed of Tuyuhun, Shatuo, and Qibi units helped the Sogdian general Kang Chengxun 康承訓 (809-74) to suppress the military mutiny led by Pang Xun 龐勛 (d. 869) in the region of Xuzhou 徐州 (present-day Jiangsu). The disruption generated by the mutineers and their unbridled suppression by the Tang expeditionary troops caused severe problems and blocked the system of transporting goods on the Grand Canal (Twitchett 1963, 96).
The suppression of the mutiny was an absolute triumph for the subordinate commanders of the expeditionary army. The Tuyuhun leader Helian Duo 赫連鐸 (d. 894) would emerge from this military campaign as a successful commander and would be rewarded with an important military position in the Zhenwu 振武 garrison. 25 In a similar manner, his future rival, the Shatuo commander Zhuxie Chixin 朱邪赤心 (d. 887), would be named military governor of Datong 大同. Helian Duo would then resurface at the end of the seventies in support of the Tang court against the military rebellion led by Zhuxie Chixin, now Li Guochang 李國昌 (d. 887), and his son Li Keyong. 26 I have discussed the dynamics of this rebellion in detail in another article (Barenghi 2020). In this paper I analyse some aspects of the context in which the rebellion took place, as well as its long-term conse- quences for the collapse of the northern frontier and the transfer of Daibei to the administrative jurisdiction of the Khitan-led Liao. The next section demonstrates how Li Keyong's military retinue grew into a new enlarged army of heterogeneous composition in the aftermath of the unrest at the border. His growing power intensified a competition with Sogdian and Tuyuhun leaders to control transportation routes and resources so to secure loyal military followers. The Tuyuhun leaders, weakly supported by the Tang court, found stronger patrons in the governors of the eastern provinces. The region north of the Yanmen Pass remained an important reservoir of recruits and military support for Li Keyong and the Shatuo regimes well into the tenth century; however, the Shatuo leaders struggled to secure control of their core armed followers, progressively moving away from their base of support or losing soldiers to their competitors.

3
Feeding the Troops: Authority and the Control of Military Resources As mentioned above, the sources provide only approximate figures and almost no detail concerning the composition of the new settlements. Indeed, the relocation of large numbers of people would presumably have required a considerable logistical effort. It is likely that the transfer was entrusted entirely to the local administration and that the reports on these operations did not survive.
The new Daibei settlers constituted a large pool of fighting men for the Hedong provincial armies. Su Hang distinguishes different periods of development in the use of foreign (fan 蕃) armed units: in the early Tang period, chieftains of Central Asian seminomadic polities or confederations were enlisted by the Tang armies as troop commanders, yet their followers or family units did not constitute the core of their armies, and most importantly were not organised into longterm standing troops on the frontier. Even when groups of armed followers were enrolled as part of the army, Su notes, they were strictly framed within the army system and separated from their leader. Through the second half of the Tang dynasty, Central Asian chieftains not only became commanders of frontier armies, but they also had direct command of their own armed followers and clans, to whom they were tied through kinship. As highlighted by Su, the leaders of these new migrant forces were not only offered the possibility of a military career in the ranks of the Tang armies, but their armed followers became the core force of those armies. These commanders were subordinated to the Tang provincial governors, and the terms of the patron-client relationship between the two parties entailed military obligations rewarded with military titles and honours as well as compensation paid to individual soldiers (Su 2010, 268 were constantly renegotiated under the ever-present threat of mutiny or desertion to armed competitors. 27 The military retinues and their respective Tuyuhun, Sogdian, and Shatuo leaders not only guarded the frontier garrisons, but for decades made up the core force of the expeditionary troops (xingying 行營), special army corps that could intervene militarily outside the jurisdiction of the province where they served as standing armies. 28 The frequent unrests caused severe backups in the river-and canalbased transport of goods to the capital region and the northern garrisons, as in the case of Pang Xun's mutiny. Indeed, putting down such rebellions was a chance for the commanders to extend their control over goods transport, as well as to reinforce the loyalty of their military followers by rewarding them with the spoils of combat.
After the An Lushan rebellion, and for most of the ninth century, the Tang court failed to extract enough tax revenue from the sparse population in Daibei and most of Hedong to cover the costs of the standing armies in this area (von Glahn 2015, 215). The maintenance of the large northern military garrisons thus depended almost exclusively on the transport of grain and commodities from the southern provinces through the system of canals that connected the Yellow River to the Yangzi valley. During the eighth century, special plenipotentiary commissioners for land and water transport 水路轉 運使 named by the Tang court supervised the transport and administration of goods in transit from the southern provinces to the corridor between the two capitals, Luoyang 洛陽 and Chang'an. They also supervised goods going through Liangzhou 涼州 that were headed to the military jurisdictions of the north-western territories. 29 The system of canals facilitated south-north communication, and yet the transport of bulk commodities was problematic for many reasons, including geography. Major problems included frequent military unrest near transport hubs, which blocked the flow of goods, and widespread corruption among the commissioners in charge of supervising the transport of goods and the collection of tax revenues. 30 By the end of the eighth century, the court had appointed a Daibei plenipotentiary commissioner to supervise water and land transport as well as the military colonies 代北營田水運使. The few references to goods transport and tax revenues in the sources are cases of mal- function and corruption: the first mention of a Daibei commissioner dates to the beginning of Xianzong's 憲宗 reign (r. 806-820) and refers to a possible case of bribery. Around 811, the Revenue Department opened an investigation concerning a violation of fiscal law, conducted by the vice director of the Revenue Department at the time, Lu Tan 盧坦 (748-817). The case allegedly occurred in the last years of Dezong's 德宗 reign (r. 780-805), when Xue Jian 薛謇, a former Daibei commissioner and experienced horse breeder with several hundred horses on his farm, allegedly bribed the powerful eunuch Xue Yingzhen 薛盈珍 with a number of fine unregistered horses. According to the investigation, the bribery would have brought Xue Jian and his kin privileges and career advancement. The sources speak of an attempt by the court to interfere with the case, but do not report the outcome of the investigation. 31 The Tang court subsequently named Han Chonghua 韓重華 as the new Daibei commissioner. On behalf of the court, Han supervised an area that extended from Daibei to the land north of the Yellow River northern loop, including the frontier garrisons and fortifications of the Central Fortress for Receiving Surrenders 中受降城 (see map), at the old fortification of Tiande 天德 and Zhenwu 振武. Han was responsible for overseeing agriculture for the sustenance of the garrisons, the purchase of grain at fair market prices, and water and land transportation 振武、京西營田、和糴、水運使. 32 The court's appointment of a commissioner to supervise the new military colonies was an attempt to exert direct control over the market for military supplies and deter speculation.
To overcome the problems of inefficiency and the malfunctioning of the military supply system, moreover, the court began endorsing plans to seize abandoned or untilled agricultural land and transform it into farmland to sustain the garrisons in the region between Zhenwu and Yunzhou. As an example, when severe famines hit the military garrison in Zhenwu in 815, Chancellor Li Jiang 李絳 (764-830) requested that farmlands be opened to sustain the garrisons, in order to "conserve expenditures on the tax bureau's transportation of grain by water and avoid fraud on purchase of the grain [for troop provisioning] through the equitable marketing system". 33 It is unlikely that the plan extended further west, since the westernmost fortification at the border with the Tibetan territory (the Western Fortress for Receiving Surrenders 西受降城), had been destroyed by flooding from the Yellow River, which in that area bends eastwards forming several branches. As consequence of the flood, the standing troops were moved east to Tiande. 34 Under commissioner Han's administration, abandoned farmland of several hundred hectares was made arable again, stretching for more than six hundred miles from Yunzhou up to Zhenwu and the Central Fortress. More than nine hundred officials convicted of various bribery and robbery-related crimes were provided with ploughing tools and oxen and employed to till the land and grow grain as a way to repay their debts, generating an abundant harvest for two consecutive years. Commissioner Han ordered the construction of fortified camps and palisades to protect the new farmland. Units of up to three thousand soldiers were recruited to guard the forts. Strengthened by the success of this project, Han requested the court open up more new farmland. His plan was to employ up to seven thousand men to provide for five fortified cities in all. Chancellor Li had already been dismissed when Han submitted his request, however, and the new chancellor put an end to the plan. 35 Despite the considerable efforts undertaken to create new land suitable for agriculture, the project was never fully implemented. The scarcity of farmland and short growing season made the task even more difficult.
In the 840s, the Daibei plenipotentiary commissioner responsible for farmland and transport on land and water added military duties to his repertoire. The newly established Datong Militia Commissioner 大同都團練使, renamed Datong Defense Commissioner 大同防禦使 one year later and given a seat in Yunzhou, administered the civil, fiscal, and military affairs of the three prefectures of Daibei (Yunzhou, Shuozhou, and Yuzhou). This shift was another attempt by the court to exert control and to drastically limit the Hedong provincial military governor's authority over the stationary troops to the north. 36 In keeping with this attempt, in the late 850s the court appointed a son of emperor Wuzong 武宗 (r. 840-46), Li Yi 李嶧, as Datong Defense Commissioner. 37 In the 870s, the commissioners sent by the court became the target of a series of military mutinies led by secondary frontier commanders in the Datong army. The sources say that the commissioners were accused of greed and corruption, yet it is not implausible for these military rebellions to have been triggered by power struggles between court commissioners and the leaders of the local armed communities over the control of resources. The Shatuo commanders took advantage  385 of the situation to emerge as authoritative leaders of the mutinies. One after another, Lu Jianfang 盧簡方 (793-874 or 878), Duan Wenchu 段文 楚, and Zhi Mo 支謨 (829-879) were either brutally murdered or killed in dubious circumstances, along with their civil retinues. 38 The celebrated leader of the mutiny, Li Keyong, claimed the position of Datong defense commissioner for himself. When the Tang court refused, Li Keyong and his father, Li Guochang, initiated a military uprising that spread like wildfire across the northern garrisons and south to the rest of Hedong as far as Jinyang 晉陽 (Taiyuan). Li Keyong attempted to seize control of the transport routes on water and land amid the chaos, exacerbating the competition with other militia leaders stationed at the border garrisons. Helian Duo and several Sogdian generals came forward in support of the court's attempt to suppress the military rebellion, as well as to defend their interests in Daibei. The sources show that Sogdian Anqing 安慶 and Sage 薩葛units led by Shi Jingcun 史敬存and Mi Haiwan 米海萬 emerged as particular competitors of Li Keyong in these years. 39 The successful military campaign led by the military governor Li Zhuo 李琢 in the summer of 880 forced Li Keyong and his family to flee into Tatar territory and led to official appointments at the prefectural level for Tuyuhun and Sogdian military leaders. Helian Duo was appointed Yunzhou prefect and Datong defense commissioner, with command over the Datong garrison. His Tuyuhun affiliate, Bo Yicheng 白義誠, similarly became Yuzhou prefect and the Sogdian Mi Haiwan Shuozhou prefect. 40 Supported by the neighbouring Lulong 盧龍 army, led first by the Uyghur Li Keju 李可舉 (d. 885) and then by Li Kuangwei 李匡威 (d. 893), Helian Duo effectively controlled the Datong military garrison for a decade. After he died in battle in 894, 41 the position of Daibei defence commissioner was given only to men affiliated with Li Keyong: the Sogdian general Shi Shanyou 石善友was first, 42 followed by Li Keyong's military fellows and affiliates Xue Zhiqin 薛志勤 43 and Li Cunzhang 李存璋. 44 At beginning of the tenth century, the duties of the Daibei commissioner were taken up by the commissioner of water and land transpor- ties. As a reward for service and clientship Li Keyong bestowed upon them the surname Li 李, the imperial surname that once the emperor had bestowed upon Li Keyong's father. Thereby doing, Li Keyong was usurping an exclusive prerogative of the Tang ruling house. Most of the yi'er were career military professionals, and their identification as 'Army of Adopted Sons' remained an unofficial affiliation that did not preclude them from holding official military positions in the Tang system. Ouyang Xiu's "Collected Biography of the Army of Adopted Sons" is the first and only attempt to provide a clear-cut definition; the chapter collects short biographies of eight such 'adopted sons', though the yi'er numbered over one hundred. 50 Below the rank of the 'adopted sons' elite was a large army of mercenary manpower that did not enjoy similar privileges and was likely to follow whoever emerged as an authoritative leader and offered the best patron-client conditions. Li Keyong's flight into Tatar 51 territory left these former clients on the frontier in disarray. 52 Some of Li Keyong's affiliate commanders who were quartered at various garrisons in Hedong and still held official positions in the Tang provincial system attempted to maintain ties with these armed men by enrolling them once again into the Tang expeditionary troops. When the rebel army led by Huang Chao 黃巢 reached the capital region and entered Chang'an, the Hedong army supervisor Chen Jingsi 陳 景思 was commissioned by the court to move the Daibei expeditionary troops to the capital. On his way south, Chen was persuaded by his subordinate commanders Li Youjin 李友金 (quartered with the troops in Yuzhou), and Qu Zhen 瞿稹 (the prefect of Jiangzhou 絳州), both of whom were associates of Li Keyong, of the necessity of recruiting more troops in order to be able to confront the rebellion. 53 Chen subsequently headed back to Daizhou and enlisted thirty thousand armed men, "all mixed Hu from the north" 北方雜胡 (Shatuo and more than eight thousand Central Asian warriors as his sons and used them as his elite private guard. See Skaff 2012, 224 ff. 51 The Tatars (Dada 達靼) were a small confederation originating in southern Manchuria, northeast of the imperial border. At the beginning of the ninth century, Tatar settlements were also present in the territories beyond the north-western frontier, as far as Beshbalïk, in present-day eastern Xinjiang (ZZTJ 246.7968, Sogdians from the Anqing and Sage clans, and Tuyuhun recruits). 54 While the expeditionary army were quartered in Jiangzhou, the Shatuo commander Di Ji 翟稽 pillaged the prefecture, mutinied against his superiors, and threatened to head back north. 55 Li Keyong's fellow commanders then persuaded Chen Jingsi that only the Shatuo leader himself had the military authority necessary to lead such an unruly and violent army. 56 The court then allowed Li Keyong to return from the north, condoning his mutiny, and summoned him to Yuzhou. He used the trip as an opportunity to plunder the northern garrisons and recruit new manpower. 57 Moving south towards to the capital Chang'an, Li Keyong reached Taiyuan and requested that the governor Zheng Congdang 鄭從讜supply food, provisions, and rewards for his troops. When Zheng Congdang refused, Li Keyong let his troops "run unrestrained" (zong 縱) to attack and loot the city. 58 Despite or perhaps because of his unorthodox and disruptive methods, Li Keyong was put in charge of a large and powerful new army that enabled him to march on Chang'an and launch a deadly assault on Huang Chao's troops, even recruiting some of Huang Chao's former affiliates. When the command of the military garrison of the Yanmen Pass also came under his control, as well as authority over most of Hedong's garrisons, Li Keyong was proclaimed Hedong military governor and Prince of Jin 晉王. 59 Li Keyong now controlled most of the military force of northern Hedong: all but Yunzhou, which was still Helian Duo's stronghold. He formally petitioned the court to return the three Daibei prefectures to his command and abolish the position of Datong military commissioner. 60 This last request was probably not fulfilled, as Helian Duo continued in office until at least 891, if not his death in 894. In 890, Li Keyong moved against Helian Duo in a series of attacks on the city of Yunzhou. Helian Duo's powerful eastern neighbour and new patron, the Lulong military governor Li Kuangwei, allegedly sent in an army of thirty thousand soldiers to rescue his client. These successfully defeated the commanders under Li Keyong, some of whom surrendered to Helian Duo. 61 In retaliation, Li Kuangwei attacked Yuzhou and took its prefect Xing Shanyi 邢善益 as hostage, even as Helian Duo led an army of 54 JTS 19b.710 several hundred thousand Tibetan and Kyrgyz (Xiajiasi 黠戛斯 in the Chinese sources) 62 troops in an assault on the Zhelu garrison 遮虜軍, killing area army commander Liu Huzi 劉胡子. Li Keyong sent his commander and foster son Li Cunxin 李存信 to respond to the attack, but the attempt failed. The winning card for Li Keyong, at least in Sima Guang's telling, was to send another commander from his 'Army of Adopted Sons': Li Siyuan. The military campaign was successful: Helian Duo and Li Kuangwei were forced to leave, and Li Kuangwei's son, Li Renzong 李仁宗, and Helian Duo's son-in-law were captured. Thousands of soldiers were killed, including one thousand households (tents, zhang 帳) of Helian Duo's followers. 63 One year later, Li Keyong put Yunzhou under siege. When food supplies were exhausted and the population began to starve, Helian Duo was forced to flee east with his followers and again seek the protection of Li Kuangwei. Li Keyong took over Yunzhou and named one of his commanders, the Sogdian Shi Shanyou 石善友, as defence commissioner of Datong 大同防禦使. 64 In 892, Helian Duo and Li Kuangwei returned with an army of eighty thousand soldiers to take back Yunzhou. Li Keyong ordered Li Junqing 李君慶 to move his troops from Jinyang in response. Meanwhile, Li Keyong secretly entered Xincheng 新城 in the Shenwu Plain 神武川, ambushed Li Kuangwei's troops, and captured three hundred Tuyuhun horsemen. 65 Li Kuangwei was subsequently defeated by Li Junqing in Yunzhou, after which he set fire to the Shatuo headquarters in Yunzhou and headed east to the Tiancheng garrison. As Sima Guang reports, the number of decapitated and captured was uncountable. 66 Li Keyong launched a final attack against Helian Duo in 894, killing him and capturing his fellow commander Bo Yicheng. 67 Despite having eliminated his main competitors, Li Keyong's control over Daibei was far from stable, and the three prefectures north of the Yanmen Pass remained a disputed territory for the following 62 As suggested by one of the anonymous reviewers, these were probably not troops under Helian Duo's command but allies whom he invited to join in the attack; it is, however, unlikely that Tibetan and Kyrgyz military groups could have reached northern Hedong so quickly, as the closest Tibetans were probably located in Shaanxi while the Kyrgyz were in Mongolia or even further north. courage and resourcefulness exceeds that of ordinary men. For over ten years they have followed me in military campaigns. In recent years the state's stores have been empty. The families [of the soldiers] of all the troops have sold their horses to survive. Today all the [regional] lords have increased the rewards on offer to recruit valiant soldiers. If I restrain them now by means of laws, I am afraid they will abandon me in a crisis. How then would I be able to protect this [enterprise] by myself? Let us wait for our fortunes to improve, and I will then certainly be able to discipline them".

391
In another instance, the Old History states that after Li Keyong's army helped to suppress Huang Chao's rebellion, many of the soldiers did not abide by the rules, in some cases humiliating and insulting officials, robbing commoners, and looting and plundering in broad daylight, after which they would loiter in wine taverns and get into brawls. Despite their behaviour Li Keyong tended toward appeasement and was reluctant to restrain them. 71 The sources say that before he died in 908, Li Keyong expressed a wish to pass on his position as Prince of Jin to Li Cunxu, one of his biological sons born from a concubine, Consort Cao 曹. This decision triggered bloody struggles among Li Keyong's brothers and numerous adopted sons, valiant client soldiers who enjoyed the same privileges as his real offspring. Amid the discord, Li Keyong's younger brother Li Kening 李克寧 (d. 908) attempted to take control of Daibei by requesting to become the Datong military governor. 72 For all these reasons, Li Keyong's control over the territory and manpower north of the Yanmen Pass was far from secure in the autumn of 907, when the Liao founder Abaoji, posthumously known as Taizu, reached Yunzhou from the north-eastern steppe belt leading an army that official figures put at three hundred thousand armed men. 73 Several references in the sources mention the periodic movement south of Khitan groups in search of pastureland in early autumn, when the grasslands of the steppe had already begun to freeze over. These movements to the south, as was the case with the Uyghurs decades before, were profiteering opportunities for the border officials. The aforementioned governor of Lulong Liu Rengong, to name one example, is said to have instructed his soldiers to burn the grass outside the border fortification to force the Khitan to bribe them with fine horses in exchange for pastureland. 74 The first instance in which Abaoji shows signs of interest in the Daibei region is in early autumn 907, when he brings three hundred thousand armed men armed men with him to Yunzhou for a meeting with Li Keyong, a number a bit too high for a civil exchange or a brotherhood oath, as some of the sources labeled it. The figures are likely inflated in the sources, but Abaoji's visit indeed had the potential to become something more disruptive than a 'diplomatic' appearance. 75 The sources closest to the cause of the Shatuo, namely those drawn up at the court of the Shatuo Later Tang regime, describe the events that followed as a betrayal by Abaoji of the agreement made with Li Keyong at Yunzhou. In fact, Abaoji was one of Li Keyong's competitors in the northern territories, if not his most powerful rival. His agreement with the ruler of the newly established Later Liang 後梁 regime (907-923) to destroy the Shatuo is thus an understandable strategy. 76 In early winter 916, Abaoji, now proclaimed 'Heavenly imperial sovereign' 天皇王 of the Liao empire, 77 led a large army in a siege on Yuzhou and captured Li Siben 李嗣本 (d. 916), the military governor of Zhenwu and 'adopted son' of Li Keyong. The Liao emperor may also have attempted to secure control over resources, as the ZZ-TJ reports that he "sent an envoy with a document written on wood to ask for goods" 遣使以木書求貨 to the Datong defence commissioner in Yunzhou, Li Cunzhang. Li Cunzhang replied by beheading the envoy. Abaoji raided Yunzhou yet again in retaliation. 78 In 925 Yunzhou officials reported that the Khitan armies had returned to the north of the desert the year before and that a group of Tatar that had fought against them had fled south from the desert and reached the northern frontier. Thirty thousand people allied with the Later Tang crossed the southern border. 79 History repeated itself one more time in late summer 936, when the Hedong military governor of Sogdian origin, Shi Jingtang 石敬瑭 (892-942), sought the support of the Khitan-led Liao army in a military mutiny against the last ruler of the Later Tang regime, Li Congke 李從珂 (r. 934-37). Their new patron-client relationship acquired pronounced significance this time and is represented in the sources with a whole other level of symbolic language: Shi Jingtang, now ruler of the newly established Later Jin 後晉 (936-947), officially recognised the Liao emperor Yelü Deguang 耶律德光 (r. 927-947, posthumous title Taizong 太宗) as superior and subordinated himself to the emperor's authority. This new agreement of clientship is different from the patron-client relations seen so far between military leaders because it was sanctioned by the transfer of land to the new patron. 80 The prefectures north of the Yanmen Pass in Hedong, together with the territories of the Lulong circuit in Hebei, collectively 80 Recently scholars have been discussing how the early tenth-century diplomatic relations developed between the Shatuo-led north China regimes and the Khitan-led Liao might have created the ground for the eleventh-century interstate diplomacy of the Liao-Song Treaty of Shanyuan (1005). See for instance Xue 2020 and Soojung Han's forthcoming PhD dissertation thesis (Princeton University). known to history as the "sixteen prefectures between Yan and Yun" 燕雲十六州, became an integral part of the Liao empire as a consequence of this relationship, and would remain so for the rest of the dynasty's history. 81 5 Concluding Remarks The present article has endeavoured to shed some light upon less studied aspects of the history of Daibei in the late ninth and first decades of the tenth century, before it became Liao territory, a history woven into a severely weakened Tang military system. The paper showed how migrant mercenaries who resettled in Daibei at the turn of the ninth century grew into garrison communities dependent on Tang military resources for sustenance. The state-induced resettlement of military groups to Daibei was part of an attempt to reappropriate state space in the sparsely populated territories of the north. The military groups also served as a counter to the autonomous provinces of Hebei and to the Uyghurs. Securing control over foodways and transportation routes thus became key to securing control over troops, and exacerbated competition among different agents. By appointing plenipotentiary commissioners to supervise water and land transport as well as the military colonies, the Tang court sought to centralise its control over human and natural resources, and this centralizing drive clashed with the growing decentralizing ambitions of the military groups. The Shatuo leaders successfully enacted military and identity strategies that won them the loyalty of an enlarged army, led by an elite leadership of commanders who recognised themselves as Shatuo. Their strategies enabled them to aspire to transform their efforts as military authorities into a chance at becoming rulers of a bureaucratic state, even at the cost of losing their former military hub in Daibei, which by then had become difficult to control. Faced with the challenges of founding a state, the Shatuo rulers were unable to transform their loyal armed communities into civil and administrative units and ultimately fell to the same armies that brought them to power.
81 Together with Daibei, the administrative units of northern Hebei (corresponding to the region of present-day Beijing) were annexed by the Liao empire and transformed into the metropolitan area of the Liao Southern Capital (ZZTJ 280.9146).