The Shiwei 室韋, also written 失韋 or Shiwei 失圍, were a people living in the northeastern parts of modern Manchuria between the 5th and the 10th centuries. Chinese sources first mention them during the Northern Wei period 北魏 (386-534) and say that the Shiwei belonged to the Eastern Hu 東胡 tribes and were northern relatives to the Kitans 契丹. While the Kitans roamed the steppe region of eastern Mongolia, the Shiwei lived along the middle and lower course of the rivers Amur and Nenjiang.
Northeast China and its surroundings c. 600 CE. Based on Tan Qixiang 譚其驤, ed. (1995), Zhongguo lishi ditu ji 中國歷史地圖集, Vol. 5, Sui Tang Wudai Shiguo shiqi 隋唐五代十國時期 (Beijing: Zhongguo ditu chubanshe, 1996).
The Shiwei lived of hunting and pastoral nomadism. They were hunting for furs that they sold to their southern neighbours. Some of them were settled and engaged in agricultural activities. Their leaders were called moheduo 莫賀咄 in the native language. The Shiwei sent irregularly tributes to the courts of the Northern Wei and their successors, the Northern Qi 北齊 (550-577). In the late sixth century the Shiwei were divided into five different tribal groups called Northern Shiwei 北室韋, Southern Shiwei 南室韋, Bo Shiwei 鉢室韋, Shenmoda Shiwei 深末怛, and Da Shiwei 大室韋. Each of these tribal groups had different customs and were independently ruled by a chieftain. All of them were nominally vassals to the Turkish khanate.
The Southern Shiwei later disintegrated into 25 different tribes that were headed by chieftains called yumofumanduo 余莫弗瞞咄 in the Shiwei language. The Northern Shiwei consisted of 9 tribes whose leaders were called qiyinmoheduo 乞引莫賀咄 and were assisted by three mohefu 莫何弗. Males used to tie up their hair, while women had a disc-like hair shape. The Shiwei used oxen carts.
During the Tang period 唐 (618-907) the Shiwei consisted of more than twenty tribes. The so-called Mengwu Shiwei 蒙兀室韋 who lived at the banks of River Erguna are said to be the ancestors of the Mongols 蒙古. All Shiwei tribes delivered irregular tributes of furs to the Tang court, and their leaders were bestowed official titles of the Tang empire. In 788 the Shiwei and the people of the Xi 奚 attacked the Tang garrison in Fuzhenwu 撫振武 (modern Helinge'r 和林格爾, Inner Mongolia), but they offered an excusion a year later. In the tenth century the Shiwei were incorporated into the federation of the Khitans that founded the Liao dynasty 遼 (907-1125) that would eventually conquer northern China.