Little is known about Zhang Yuxian's background besides the fact that he served as a minor official at the county government of Boluo County.
In 942, Southern Han was ruled by Emperor Liu Bin. Many disorganized groups of bandits were dispersed throughout Xun Prefecture (循州, in modern Huizhou). They came to support Zhang to lead the overall movement, and he took the title of "King of the Eight Kingdoms of Middle Heaven" and established a government. His army attacked the coastal region and seized much of the territory. However, it was said that he himself was young, lacking experience and strategy. He took reports from his generals but had little direction for them.[2]
Liu Bin reacted by sending his brothers Liu Hongchang, Prince of Yue, and Liu Honggao, the Prince of Xun, to command an army against Zhang. However, Zhang's army surrounded and defeated them. Only through the efforts of the officer Chen Daoxiang (陳道庠) were the two princes able to escape. Most of Southern Han's eastern prefectures fell to Zhang, including Xun. However, in the summer of 943, the Han general Wan Jingxin (萬景忻) defeated Zhang's army at Xun.[2]