Set in the late Tang and early Song dynasties, the story follows Ning Caichen, a scholar with no hope of passing the imperial examinations. He opens a school at Lanruo Temple and takes in orphans, falling in love with the little demoness Nie Xiaoqian. When Ning Caichen ventures into the demon realm to save his classmates, who have been bewitched by monsters, he is discovered by Granny. Xiaoqian sacrifices herself to save him. After escaping the demon realm, Ning Caichen is overcome with grief and loses all his memories. By a twist of fate, he meets Xiaohaha, the Imperial Preceptor’s daughter, who looks exactly like Xiaoqian. The two fall for each other and overcome many hardships to be together. Granny wants to break the seal and take control of the human world, so she resurrects Xiaoqian and sends her to kill Ning Caichen and Yan Chixia and seize the Heart Sutra. Xiaoqian resents Ning Caichen for being with Xiaohaha, but her true love for him keeps her from striking. When Ning Caichen learns the truth, he ventures into the demon realm to save Xiaoqian, only to fall victim to Granny’s magic and nearly make a terrible mistake. Granny leads the demons in ravaging the human world. Convinced that true love cannot be defeated, Ning Caichen, with everyone’s help, rescues Yan Chixia and thwarts Granny’s scheme in time. But Xiaoqian is hurt saving Ning Caichen and Xiaohaha, and in the end her soul is scattered forever. Peace returns to the world, but Ning Caichen lives out the rest of his days in regret, growing old alone with Xiaoqian’s keepsake.