When the Liangshan heroes led by Lu Junyi attacked Dongchangfu, they were severely defeated by Zhang Qing and even after Song Jiang came with reinforcements, the Liangshan heroes still could not win Zhang Qing. Zhang Qing defeated about fifteen of Liangshan's top generals. Eventually, Ding Desun was trapped by Lu Fang and Guo Sheng, then, Yan Qing fired an arrow which hit Ding's horse, and the wounded horse threw Ding to the ground. Lu and Guo then easily captured Ding. In the end, Zhang Qing was subdued by the Liangshan heroes and he agreed to join the Liangshan band. Ding Desun and Gong Wang also joined the band as well.