After traveling for a day, they suddenly saw a huge mountain, towering into the clouds, called the Five Elements Mountain. Tang Monk arrived at the foot of the mountain and vaguely heard someone shouting from under the mountain: «Master! Master! Save me!» Tang Monk was startled, and following the sound, saw a monkey pressed under the mountain. The monkey called himself Sun Wukong, who five hundred years earlier had caused great havoc in Heaven and was pinned under this mountain by the Tathāgata Buddha, and now, guided by Guanyin Bodhisattva, was here waiting for the pilgrim to the scriptures.
Sun Wukong begged Tang Monk to save him, and Tang Monk asked how to do it. Sun Wukong said: «On top of this mountain there is a golden seal with words; you just remove it, and I will come out.» Tang Monk followed the instructions and climbed the mountain, where he indeed saw a talisman with the six-character true mantra, and reverently tore it off. As soon as the talisman was removed, there was a tremendous roar, the mountain split apart, and Sun Wukong leaped out from the rock crevice, bowed to the ground, and kowtowed, saying: «Master! Your disciple Sun Wukong is willing to follow you to the Western Heaven to obtain the scriptures!»
The master and disciple bid farewell to the mountain god and the local deity, and continued on their way. After traveling a few more miles, they suddenly encountered six robbers blocking the road. Seeing this, Sun Wukong raised his As-You-Will Golden Cudgel and in an instant killed all the bandits. Tang Monk, seeing him kill, felt compassion and scolded: «Wukong! How can you, a monk, harm lives like this!» Sun Wukong tried to explain, but Tang Monk would not listen and recited the Heart Sutra as a punishment. Sun Wukong, annoyed, sulked and wanted to leave.
Just then Guanyin Bodhisattva appeared and gave Tang Monk a flowery hat, inside which was hidden a headband. When Sun Wukong returned, Tang Monk tricked him into putting it on and then chanted the spell. Sun Wukong immediately had a splitting headache. Sun Wukong begged for mercy repeatedly, and only then did Tang Monk stop. From then on, Sun Wukong knew the power of the Headband Sutra and no longer dared to disobey, and thus loyally accompanied Tang Monk to the Western Heaven to obtain the scriptures.