Sun Wukong told the king what he had discovered, and the king was half convinced and half skeptical. Sun Wukong, together with Zhu Bajie and Sha Seng, cleaned the filth from the pagoda and found on its top the words 'Nine-Headed Insect's Green Blood' left by the Dragon King of Ten Thousand Saints. The next day, Sun Wukong and Zhu Bajie went straight to the Blue Wave Pond, where they saw the Dragon King of Ten Thousand Saints hosting a banquet, attended by the Nine-Headed Insect and other monsters. Sun Wukong and Zhu Bajie stormed the Dragon Palace, overturned the banquet, and started a fierce fight. The Nine-Headed Insect possessed great magical powers; it had nine heads and spewed black smoke, making it a very difficult opponent. Sun Wukong engaged in an intense battle with it, but neither could gain the upper hand. At a critical moment, Erlang Shen happened to pass by with his Mei Mountain brothers, saw the situation, and came to help. Erlang Shen's Howling Celestial Dog bit off one of the Nine-Headed Insect's heads; the Nine-Headed Insect was wounded and fled, disappearing without a trace. Sun Wukong and the others subdued the Dragon King of Ten Thousand Saints and his monsters and recovered the Sarīra Buddha relic. The king of the Sacrifice Nation was overjoyed, richly rewarded the monks, and held a farewell banquet for Sun Wukong and his companions.
The four masters and disciples bid farewell to the Sacrifice Nation and continued their journey westward. Arriving at a place overgrown with ancient cypress trees and dense brambles, they found themselves at Thorn Ridge. Tang Sanzang was blown away by a gentle breeze and, in a daze, was invited by the tree spirits — Eighteen Gongs, Solitary Straight Gong, and Soaring-in-the-Void Gong — into the Wood Immortal Nunnery. All the tree spirits were refined scholars, drinking wine and composing poetry with Tang Sanzang, discussing Zen and the Dao. Tang Sanzang was so absorbed in the revelry that he felt no fear. Suddenly, a beautiful demoness named Apricot Fairy performed a dance and then offered to marry Tang Sanzang. Sun Wukong arrived, saw the scene, and flew into a rage; he swung his Ruyi Golden Cudgel and killed all the tree spirits, then dispatched the Apricot Fairy as well. Although Tang Sanzang was rescued, he scolded Sun Wukong for killing indiscriminately. Sun Wukong was displeased but had no choice but to protect Tang Sanzang and continue their journey onward.