In the second year of Yongjia (308), the imperial court promoted Zhang Guang to be the general of materials officer and the secretariat of Liangzhou. In April of the first year of lite (3 13), Liu Yun, Wang Jian, Yang Wu and others, the remnants of anti-thief Wang Ru, led more than 3,000 families from Xiangyang to Hanzhong, and Zhang Guangpa sent people to join the army and led troops to Jin (place name) to stop them. Jin Miao accepted a lot of bribes from Liu Yun and others, and persuaded Zhang Guang to accept their surrender. Zhang Guang then agreed to let them live in Chenggu. Soon, Jin Miao discovered that Li Yun and others had many precious properties and wanted to take them all away, so he said to Zhang Guang, "Li Yunren is not engaged in agricultural production, but specializes in making weapons. Their intentions are hard to predict. It is better to kill them all by surprise, otherwise they will definitely make trouble. " Zhang Guang obeyed him again.
In May, "Zhang Guangpa Jin Miao attacked Liu Yun and others, but failed to win. Zhang Guang turned to Bian Wang Yang Mao for help, and Yang Mao sent his son Yang Nan to help him. Yang asked for property, but he didn't give it. Yang Wu (yang hu) bribed Yang Nan and said to him, "All the objects of the demolished people are in Zhang Guang's place. Now that you attack me, you might as well attack Zhang Guang. " Yang was overjoyed, threatened to help, and secretly colluded with him. Zhang Guang didn't know the inside story, so he sent his sons Zhang Mengchang and Zhang Yuanqian to help Jin Miao. Liu Yun and Yang Nan attacked Jin Miao and others, and Zhang Meng Chang and Bird were killed. Thieves and soldiers were rampant and trapped in the city. In September, Zhang Guang fell ill because of anger and excitement. The subordinate officials and people advised Zhang Guang to retreat to Weixin, and Zhang Guang said according to the sword: "I accept the heavy responsibility of the state and can't destroy thieves and bandits. To die today is like being immortal. Why retreat? "After that, he died at the age of 55. People cry, and people near and far sympathize with him.