and grandfather had held office on a provincial and prefectural level, but who claimed ancestry from the prominent middle-Tang official Yuan Shuji. (Her son with Yuan, Yuan Xiangxian, would later be an important general during Zhu Wen's Later Liang and the succeeding Later Tang.) Zhu Cheng died while Wen was still a boy, likely about 864, or after. His widow brought her three sons to live in the household of Liu Chong () of Xiao County, Xuzhou. Zhu Cheng's mother is known to have been surnamed Liu. It is therefore possible that Liu Chong was a relative of Zhu Wen's grandmother. If this was in fact the case, Zhu Cheng's origin can not have been too obscure since the Liu family was the leading family in the area. The marriage of the daughter into the Yuan family also indicate a family of some standing. Zhu Wen was brought up to be a family retainer or manor steward, but it is said that the people in the Liu household did not view him highly, except Liu Chong's mother, who in fact had to intercede whenever Liu Chong, displeased with Zhu Wen, caned him. Zhu instead went on to form his own bandit gang, one of many operating between the Yellow and Huai Rivers. In about 877 Zhu Wen and the second brother, Zhu Cun (), joined the rebel army of Huang Chao when it fought its way through the region. Cun was later killed in battle, but Wen rose through the ranks until given a separate command following Huang Chao's capture of the imperial capital Chang'an in January 881. With this army Zhu Wen attacked and captured nearby Tong Prefecture (同州, in modern Weinan, Shaanxi), becoming defense commissioner of that prefecture. Many of the military governors had submitted to Huang Chao following his capture of Chang'an, but soon reverted to the Tang court once they realized that cause was not yet lost. By 882 Huang Chao was effectively surrounded, controlling only two prefectures outside Chang'an, one of which was Zhu Wen's Tong Prefecture. Wen now found the time opportune to change sides. After first assassinating his military overseer Yan Shi (), sent by Huang Chao to guard against just such a possibility, Zhu Wen surrendered to the Hezhong Circuit (河中, headquartered in modern Yuncheng, Shanxi)'s military governor (Jiedushi), Wang Chongrong. As reward for his timely defection Emperor Xizong of Tang appointed