When they arrived at Liangshan Marsh, they saw that on the Loyalty Hall, Chao Gai, Song Jiang, and all one hundred and eight heroes were present. Chao Gai and Song Jiang descended from the hall to welcome him, saying: 'We have long heard of the great reputation of the Jade Unicorn; seeing you today is truly a fortune for our stronghold!' They held a banquet to entertain him, offering fine wine and excellent meat. Lu Junyi saw how respectfully these outlaws treated him — all of them were gallant men of the jianghu — and though startled in his heart, he also felt admiration. Chao Gai and Song Jiang repeatedly urged him to stay and tried to persuade him to join their band. Lu Junyi's mind was occupied with his family, property, wife, and children; he only excused himself by saying he must return home and refused to become an outlaw.
After Lu Junyi had stayed at Liangshan for several days, unable to refuse their pleas, he finally agreed to 'stay a while longer, settle my family affairs, and then return.' Seeing his determination, Chao Gai and Song Jiang did not force him further and simply allowed him to go down the mountain. When Lu Junyi and his party returned to Daming Prefecture, they found that everything at home had changed — the place was no longer the same. It turned out that Li Gu, seeing that Lu Junyi had been away for a hundred days, had committed adultery with Lu Junyi's wife, Pan Jinlian, and had seized the family fortune.
Li Gu and Pan Jinlian conspired together, embellishing the story of Lu Junyi's stay at Liangshan and reporting it to the authorities of Daming Prefecture. Li Gu also used the rebellious poem written by Wu Yong as false evidence to frame Lu Junyi for colluding with Liangshan to rebel. Liang Zhongshu, the commissioner of the Beijing garrison command, received the accusation and, enraged, immediately sent troops to arrest Lu Junyi.
Lu Junyi was captured and thrown into prison, suffering severe torture in Daming Prefecture. To curry favor with his father Cai Jing, Liang Zhongshu intended to convict Lu Junyi and have him executed. Fortunately, Yan Qing was alert; noticing something unusual at Lu's residence, he secretly investigated and learned the full truth. Yan Qing found a chance to slip away, disguised himself, and rushed overnight to Liangshan, reporting to Song Jiang and Chao Gai how Lu Junyi had been falsely accused and imprisoned. When the people of Liangshan heard the news, they were all shocked and furious, swearing to go down the mountain and rescue Lu Junyi.
It is said that Song Jiang, seated in the Loyalty Hall, learned that the Jade Unicorn, Lu Junyi, had been framed by Li Gu, thrown into prison in Daming Prefecture, and that his life or death was uncertain. Song Jiang, worried, sent Dai Zong and Li Kui to Daming Prefecture to gather information.