At the end of the Han Dynasty, central Shanxi is plagued by wars and overrun by refugees. Cia Wenji’sfather, Cia Yong, is imprisoned and tortured to death, leaving Cai Wenji a refugee. The nomadic Huns are at this time robbing and abducting Chinese Han citizens. Wenji is abducted by the Huns and, due to her beauty, presented as a gift to KingZuoxian. She becomes the king’s beloved wife and lives for twelve years with the nomadic Huns. She has two sons then.
During the time Cia Wenji lives among the Hun nomads, Cia Yong’s old friend Cao Cao has managed to settle the unrest in the North and has started full scale reconstruction of the country. Cao Cao remembers that his old friend Cia Yong has a daughter who has been wandering among the foreign nomads. So Cao Cao sends an envoy to the Huns seeking the repatriation of Cia Wenji. Upon arrival, Cao’s envoy presents KingZuoxian with an abundance of gifts and then reveals the purpose of their visit.
Since Cao Cao’s unification of the North, the nomadic Huns have found it difficult to confront such force. Upon hearing the envoy’s intention, King Zuoxian does not dare to defy the demand. When Cia Wenji hears about this, she is full of both joy and sorrow—joy, because after so many years, her wish to return to her homeland has finally come true; sorrow because if she goes home, she will have to leave her two sons behind and may never be able to see them again. After much inner torment, Cia Wenji finally decides that she will return to her homeland. After her return, she composes the Eighteen Beats to a Nomad Flute to commemorate the many years that have passed and her reflection on home, country, her home town, and family love.