of the Tang realm. Emperor Xizong, as an emergency measure, ordered the armies of various circuits to rendezvous with Cao at Yin River (溵水, a major branch of the Shaying River) to try to block of Huang's advance. However, Huang defeated Cao, and after a mutiny at nearby Zhongwu Circuit caused the death of the military governor of Zhongwu, Xue Neng (), Qi Kerang, the Tang general in command of the Yin River defense, abandoned the defensive position, causing Huang's path toward the Tang eastern capital Luoyang to become wide open. In light of his obstacle being removed, Huang headed straight for Luoyang; on the way, he stopped pillaging other than to force young men into his army and adding to its numbers. Luoyang quickly fell and was captured on 22 December 880. Emperor Xizong and Tian Lingzi conscripted a new army and put Zhang Chengfan () in charge of it, having him rendezvous with Qi at Tong Pass to defend against Huang's advance toward Chang'an. However, Emperor Xizong and Tian were instead making plans to flee to Xichuan Circuit (西川, headquartered in modern Chengdu, Sichuan), where Tian's brother Chen Jingxuan was military governor. As soon as news arrived that Huang had defeated Zhang and Qi and was advancing quickly toward Chang'an, Emperor Xizong and Tian abandoned Chang'an and fled toward Chengdu, arriving there in early 881. Huang entered Chang'an and declared himself the emperor of a new state of Qi. He slaughtered members of the Tang imperial family and a large number of high level officials, but tried to keep the Tang governmental apparatus in place for some time, hoping to get Tang generals and officials to switch loyalty. After Chang'an's fall, a number of Tang military governors, including Zheng Tian, Wang Chongrong, Wang Chucun, Tuoba Sigong, Cheng Zongchu (), and Tang Hongfu (), rendezvoused near Chang'an and then attacked Chang'an, hoping to recapture it for Emperor Xizong. In summer 881, Huang briefly abandoned Chang'an, but as soon as he realized that the Tang forces entering Chang'an were intent on pillaging it, he counterattacked and inflicted great losses on the Tang forces, forcing them to abandon Chang'an again and killing Cheng and Tang Hongfu. For the next several years, he would not again be dislodged from Chang'an despite Tang forces' efforts, and Emperor Xizong himself made no real efforts in trying to organize imperial troops to do so. With