Xiangyong 鄉勇 "village braves" were local militia recruited ad hoc for the defense of villages during the Qing period 清 (1644-1911), yet the system had precursors.
Local militia (xiangbing 鄉兵) existed already in earlier ages. The Later Jin dynasty 後晉 (936-946), of the Five Dynasties 五代 (907-960), ordered that one able-bodied male (zhuangding 壯丁) was to be provided by seven tax-liable households. Arms were to be supplied by the recruit himself (zibei 自備). To some extent, the communal self-defense system (baojia 保甲) also included a militia system fighting beyong the borders of the neighbourhood and the village. The Song dynasty 宋 (960-1279) used village militia in addition to the professional army, mainly to defend border regions against incursions by the Liao 遼 (907-1125) or Western Xia 西夏 (1038-1227) empires. Under the Southern Song 南宋 (1127-1279), many volunteers fought against the Jurchens which had invaded northern China and established the Jin empire 金 (1115-1234). The size of militia units were often geared to that of the the communal self-defense system, with small security groups (xiaobao 小保) of five persons, large security groups (dabao 大保) of 25, and superior security groups (dubao 都保) of 250 persons, but the old Tang-period 唐 (618-907) arrangement in small companies (50 persons) was also common.
The Yuan dynasty 元 (1279-1368) made use of local recruits of various tribes in northern, southern and southeast China to take over local defense against bandits. Such were the zhajun 乣軍 (zha 乣 was a contemporary term for northern tribes), Qidan jun 契丹軍 (Kitans), Nüzhen jun 女真軍 (Jurchens) or Gaoli jun 高麗軍 (Koreans) in the northeastern region, the cunbaijun 寸白軍 in Yunnan, or shejun 畬軍 in Fujian. The rebellion of the Red Turbans (huangjin qiyi 紅巾起義)was countered by the local recruitment of volunteers (yibing 義兵).
Although local militia were not deemed to be real "soldiers", some Ming period 明 (1368-1644) commanders like Qi Jiguang 戚繼光 (1528-1588) included local militia in regular military household registers (junji 軍籍), like for instance, the Zhejiang Army (Zhejun 浙兵) which was to defend the coastal cities against pirates. Yet other local militia, like the "Hairy Gourd Army" (mao hulu bing 毛葫蘆兵) of Songxian 嵩縣, Henan, remained an irregular force.
The earliest use of village militia during the Qing occurred in 1730, when governor-general Ortai (E'ertai 鄂爾泰, 1677-1745) used them as auxiliary troops who supported the regular soldiery against attacks by native tribes. The high time of village militia began in the late 18th century. The first large-scale recruitment occurred in Fujian during the campaing against the rebel Lin Shuangwen 林爽文 (1756-1788) in Taiwan. The milita were called yigong 義勇 "righteous braves" and fought side by side with regular troops. The war against the White Lotus rebellion that broke out in the borderlands of Hunan, Sichuan, and Guizhou in 1794 required large-scale recruitment of local militia in the region. The recruits were first trained before being dispatched and were therefore also known as tuanlian 團練, tunlian 屯練, minzhuang 民壯, xiangtuan 鄉團, liehu 獵戶 "hunters", yutuan 漁團 "fishers" or shamin 沙民 "sand people". Like regular troops, they were paid and given daily rations, yet they lived not in the same camps as the regular Green Standard troops (lüying bing 綠營兵), but in militia camps (yongying 勇營). Local militia did participate in military encounters, but were also used to guard the train and the camps.
Wei Yuan's 魏源 (1794-1857) authoritative military history Shengwuji 聖武記 even says that the village militia were used in the first file, while the Green Standards followed after them, and the Banner troops (baqi bing 八旗兵) remained in the background.
The Qing court never established administrative rules for local militia, and therefore weaponry and appearance differed widely.
The successful use of many local militia contributed to Zeng Guofan's 曾國藩 (1811-1872) idea to train them better and create a better organisational system for them. His "Hunan braves" (Xiangyong 湘勇) or "Hunan militia" were organized in battalions (yingshao 營哨) and constituted the base upon which Zeng created a modern military, the Hunan Army (Xiangjun 湘軍). Li Hongzhang 李鴻章 (1823-1901) imitated Zeng's system and created the Huai Army (Huaijun 淮軍). Both armies won victories over that of that of the Taiping rebels and the rebellious Nian Army 捻軍. After the victory over these rebellions, these local militia armies were transformed into regular "defense armies" (fangjun 防軍) or "patrol units" (xunfangdui 巡防隊), the core of the later regular field army (lujun 陸軍) that replaced the old Green Standard army.