Sixteen-year-old Liniang is the daughter of a prefect. Touring the Peony Pavilion with her maid one day,Liniang dozes off and meets a young scholar named Liu Mengmei in her dream. When Liniang awakes, she falls seriously ill and paints a self-portrait before she dies. Three years later, when lodging at Plum Blossom Temple, Liu picks up the portrait and finds the woman in it familiar. He falls in love with her instantly. Liniang’s ghost appears and tells the scholar about their previous encounter. Liu intends to die for love, but the ghost of Liniang stops him, asking him instead to break her coffin the next day and resurrect her. She comes back to life, and the couple marries and moves to Hangzhou. Liniang’s mother and other family members come across Liniang and learn that Liu wins the highest honors in the imperial examination. The mother sends the others to go back to Huaiyang and deliver the good news to Liniang’s father.
Mistaking Liu for a grave robber, Liniang’s teacher visits the prefect to report Liu’scrime. Hearing that a scholar is asking to see him who claims to be his son-in-law, the prefect is outraged. Thinking that Liu has been possessed by spirits, the prefect has him beaten up and left him exposing to the severe sun. The prefect then takes the case to the emperor. In the imperial palace, the Songemperor tests Liniang with a trick and confirms her resurrection. The emperor makes Liniang princess and acknowledges her marriage to Liu. Liniang persuades her father and Liu to reconcile and the family is reunited.