The play was inspired by Giacomo Puccini's opera Madama Butterfly. The first act introduces the main character, Rene Gallimard, who is a civil servant attached to the French embassy in China. He falls in love with a beautiful Chinese opera diva, Song Liling, who is actually a man masquerading as a woman. In traditional Beijing opera, females were banned from the stage; all female roles (dan) were played by males. The first act ends with Gallimard returning to France in shame and living alone after his wife, Helga, finds out about his affair with Song and leaves him.
Act two begins with Song coming to France and resuming the affair with Gallimard. They stay together for 20 years until the truth is revealed, and Gallimard is convicted of treason and imprisoned. Unable to face the fact that his "perfect woman" is actually a man, that has been posing as a woman for 20 years to be able to spy, he retreats deep within himself and his memories. The action of the play is depicted as his disordered, distorted recollection of the events surrounding their affair.
The third act portrays Gallimard committing seppuku (also known as harakiri, ritual Japanese suicide through self-disembowelment) while Song watches and smokes a cigarette.