The Yellow Robe Demon, seeing Sun Wukong's great magical powers, conjured a demonic wind, raising dust and stones to blind Wukong's eyes, and took the opportunity to flee back to his cave. Sun Wukong returned to the Kingdom of Baoxiang and informed them of the demon's methods. Zhu Bajie, unconvinced, said: 'Brother, stop boasting! Let old Pig go and confront him!' Wukong laughed and said: 'You idiot, don't try to be brave.' Bajie didn't listen and went with Sha Seng to the Crescent Moon Cave. The Yellow Robe Demon lured Bajie into the mountains, spewed poisonous smoke, captured him, and hung him inside the cave. Sha Seng, unable to resist, fled back to the Kingdom of Baoxiang.
Seeing Sha Seng return alone, Sun Wukong knew Bajie had been harmed, which made him even angrier. He then decided to use cunning. He transformed into Princess Baihuaxiu and infiltrated the Crescent Moon Cave. The Yellow Robe Demon suspected nothing and instead complained about 'that horse groomer' causing trouble. Sun Wukong feigned docility, coaxed the Yellow Robe Demon into bringing out a golden elixir, claiming it could aid his cultivation. Sun Wukong then tricked the elixir into his mouth and escaped from the cave.
The Yellow Robe Demon discovered the golden elixir was stolen and realized he had been tricked. He was furious. He flew out of the cave and confronted Sun Wukong again. The two fought once more. The Yellow Robe Demon, unable to prevail, revealed his true form—the celestial star officer Kuimu Lang. He let out a wolf howl and spewed demon fire from his mouth. Sun Wukong grappled with him, gradually gaining the upper hand. As they fought, Taibai Jinxing arrived on an auspicious cloud and shouted: 'Kuimu Lang, you fiend, why don't you surrender!' It turned out the Jade Emperor had sent him down to the mortal world to capture him. Kuimu Lang, seeing the celestial deity, dared not fight further and had to submit.
After Kuimu Lang was taken away by the celestial deities, the demonic aura on Tang Sanzang dissipated, and he gradually regained his human form. When he opened his eyes, he found himself already in the Kingdom of Baoxiang. The king, overjoyed to see Tang Sanzang recovered, hastily prepared a feast to entertain him and thanked Sun Wukong for the grace of subduing the demon.