Having lived as a hostage in Jin for years, Hongluan, sister of Prince Di, returns to Song. She is escorted by her lover, General Yelü from Jin. As they part with each other, they sing “The Barbarian’s Song.” On the way home, Hongluan’s men rescue a woman from the sea. Soon bandits come to plunder the ship, and the people aboard scatter. Prince Di’s men, while failing to find Hongluan, see a woman floating on the sea inHongluan’s cape. They assume her to be the princess, and take her to the prince's house.
General Yelü, using the alias Lu Junxiong, comes to the Central Plains in search of Hongluan. On the other shore, Ni Si'an mourns his lovesick daughter, Ni Xiudian, who has jumped into the sea because of a broken heart. He happens to rescue Hongluan, who now has lost her memory. Shang Quanxiao, son of a minister, returns after coming out first in the highest imperial examination. Since Shang’s mother has promised to marry him to Ni Si'an’s daughter, Si'an takes Hongluan to Shang's home in his daughter’s place.
Junxiong, also taking the imperial examination, manages to come out first in the examination for military officers. The minister takes a liking to him and invites him to stay in his house. Learning that Prince Di is looking for someone to translate the letter in a foreign language brought back by his “sister,” Si'an hasHongluan disguise herself as a man and offer her services. Impressed by her ability to read the letter, the prince decides to marry Hongluan to his “sister.”
The woman who has been mistaken for the prince’s sister is none other than Ni Xiudian. On the wedding night, she meets her lover Quanxiao. In time she gives birth to a baby and so does Hongluan. Fearing the prince's punishment, Ni Si'an advises Quanxiao’s mother to pretend that both babies are her own children. The prince orders the strange case be tried by Junxiong before daybreak. All believe that Si'an andQuanxiao’s mother are guilty of adultery. Xiudian and Hongluan come to the court to claim their babies, andJunxiong’s identity is revealed. As the prince decides to execute punishment on him, he sings “The Barbarian's Song”in desperation, reviving Hongluan's memory.