Western Qin

The Western Qin (385–400, 409–431) was a dynastic state of China ruled by the Qifu clan of Xianbei ethnicity during the era of Sixteen Kingdoms. All rulers of the Western Qin declared themselves "wang", translatable as either "king" or "prince." They ruled an area corresponding to modern-day southwestern Gansu in Northwest China.

Background
The Qifu tribe was a western branch of Xianbei that resettled around the Longxi and Hexi regions during the beginning of the Western Jin dynasty around 265. Initially residing along the Gaoping River (高平川; in modern Guyuan, Ningxia), the Qifu lived a nomadic lifestyle within the Chinese interior, frequently shifting their base before finally settling at Mount Dujian (度堅山; in modern Jingyuan County, Gansu) under Qifu Sifan. In 371, Sifan submitted to the Di-led Former Qin dynasty, and he was given control over the Yongshi River (勇士川; in modern Lanzhou, Gansu) after helping them defeat a Xianbei revolt in 373.

After Sifan died in 376, his son, Qifu Guoren succeeded him. In 383, Guoren was meant to serve in Former Qin’s campaign against the Eastern Jin, but when his uncle, Qifu Butui (乞伏步頹) rebelled in the Longxi, he was sent to quell the rebellion instead. However, believing that Qin’s fall was eminent, Guoren joined Butui and declared his intention of creating his own state. Surely enough, Qin suffered a devastating defeat at the Battle of Fei River later that year, sending the state into a rapid decline. Guoren then mustered the local tribes and raised an army of around 100,000.

Early rule
After the Former Qin ruler, Fu Jian was killed in 385, Guoren claimed the title of Grand Chanyu, introduced a new reign era and built his capital city around Yongshi. This is often seen as the beginning of the Western Qin dynasty, but at this point, the Qifu had not yet named their state "Qin", and in 387, they became a vassal to Former Qin after Guoren accepted their title of Prince of Yuanchuan. Guoren spent his reign subjugating neighbouring tribes before dying in 388. As Guoren's son, Qifu Gongfu (乞伏公府), was too young, his brother, Qifu Gangui was acclaimed the new leader.

After ascending, Gangui shifted his capital to Jincheng (金城; in modern Yuzhong County, Gansu). He expanded his power by continuing to campaign against the tribes and receiving tributes from the Tuyuhun, but in 391, he first came into conflict with the Later Liang in the Hexi. In 394, Former Qin was decisively defeated by the Later Qin, and their ruler, Fu Deng was captured in battle. Although his son, Fu Chong succeeded him, Gangui took the opportunity to seize Former Qin's remaining territory. The Qifu occupied the whole of Longxi after killing Fu Chong and the Chouchi ruler, Yang Ding in battle, bringing a formal end to Former Qin.

In 395, Gangui claimed the title of King of Qin. Historiographers refer to his state as the Western Qin to distinguish it with the Former Qin and Later Qin. While he still kept the Grand Chanyu title and its auxiliary offices, he established a governmental structure that was similar to the Eastern Han and Cao Wei dynasties. Conflict with the Later Liang continued, which led to Gangui moving the capital to Xicheng (西城, in modern Baiyin, Gansu) and briefly submitting to Liang. The threat dissipated after Western Qin repelled a Later Liang invasion in 397, leading to rebellions in Liang by the Tufa and Juqu tribes, who founded the Southern Liang and Northern Liang respectively.

In 400, Gangui moved the capital to Yuanchuan (苑川, in modern Baiyin, Gansu), but shortly after, he faced a major invasion from Later Qin. He was heavily defeated and so decided to surrender to Southern Liang, ending Western Qin for a time. However, he later fled to Later Qin, where he was made a general and allowed him to hold his former territory.

Restoration and final defeat
By 409, the Later Qin was facing mounting defeats on the battlefield along with the Helian Xia and Southern Liang breaking away. That year, Qifu Gangui restored the Western Qin at Mount Dujian, once again calling himself the King of Qin. He soon returned the capital to Yuanchuan in 410 and captured several Later Qin commanderies. Due to pressure from the Xia and Eastern Jin, Later Qin could only convince Gangui to remain as a nominal vassal by appointing him the King of Henan. Gangui then campaigned against Southern Liang and the Tuyuhun. In 412, he shifted the capital to Tanjiao (譚郊, in modern Linxia Hui Autonomous Prefecture, Gansu) before he was assassinated by Qifu Gongfu.

Gangui's son, Qifu Chipan quickly defeated Gongfu and took the throne. Chipan moved the capital to Fuhan (枹罕, in modern Linxia, Gansu), where it would remain for many years. Evident from his reign was the Western Qin's endorsement of Buddhism, as the Bingling Temple was first built under him. In 414, he conquered the Southern Liang and restored the King of Qin title, but Western Qin was now in contact with Northern Liang, and the two sides fought with each other on multiple occasions. He also launched several campaigns against the Tuyuhun and other tribes to broaden his state's influence. When the Eastern Jin commander, Liu Yu conquered Later Qin in 417, Chipan submitted to Jin as a vassal. Liu Yu appointed him Duke of Henan and left his territory unscathed, but in 418, the Helian Xia conquered the Guanzhong region from Jin, and Western Qin had a new threat from the east.

The situation worsened for Western Qin in 421 as the Northern Liang vanquished the Western Liang, freeing up their western frontiers and allowing them to focus on Qin. Chipan allied himself with the Northern Wei and tried to get them to attack the Xia, but he continued to suffer losses to Xia and Liang, with his worst defeat coming in 426. Internally, Western Qin was also struggling with rebellions by their Tuyuhun and Qiang subjects. Chipan died in 428, leaving behind his son and successor, Qifu Mumo and inherently dire situation.

In 429, due to pressure from Liang, Mumo was forced to move his capital to Dinglian (定連; in modern Linxia, Gansu). In 430, Mumo offered his surrender to Northern Wei, but on his way to join Wei at Shanggui, the Xia emperor, Helian Ding intercepted him and forced him to stop at Nan'an (南安; southeast of modern Longxi County, Gansu). Meanwhile, the rest of Qin's territory was conquered by the Tuyuhun, leaving Mumo with only a lone city. In 431, Helian Ding, in a last-ditch effort to expand westward, attacked Nan'an and forced Mumo to surrender, thus ending the Western Qin dynasty. Mumo and 500 of his clan members were all executed by Xia.

Language
Shimunek classifies Qifu as a "Serbi" (i.e., para-Mongolic) language. Shimunek's "Serbi" linguistic branch also includes Taghbach, Tuyuhun, and Khitan.