René Gallimard is a member of the French embassy in China. He is mild mannered and considers himself to be a wimp and bad at seducing women. Thus, he is surprised when he meets and falls in love with Chinese opera star, Song Liling, who he considers to be the embodiment of the perfect woman, a version of one of his favorite operatic characters, Madame Butterfly. Gallimard begins a relationship with Song, a relationship that mirrors the relationship in the opera between Pinkerton and Butterfly: the cruel white man and the submissive woman.
Throughout their affair, Gallimard remains unaware that Song is actually a man playing the part of a woman, a spy for the Chinese Communist party, extracting information from him. Song's performance is so convincing and she is so demure about showing her body, that Gallimard remains unaware of Song's true sex. Through Song's submissiveness, Gallimard establishes his masculine identity.
As the affair progresses, Gallimard is promoted to vice-consul, and sets up an apartment with Song, his mistress. When his professional aspirations are foiled, however, Gallimard is discharged and returns to France with his wife, Helga. There, he tells his wife about Song and the two separate. Meanwhile, Song is punished for her affair with Gallimard, serving as a laborer for a few years. Song then goes to France dressed as Butterfly and holding a child she claims belongs to Gallimard. Gallimard is overjoyed to see her and the two continue their affair.
After being together for 20 years, Gallimard is tried for treason and imprisoned for passing secret documents to the Chinese government. In court, Song is publicly revealed to be a spy. In a dramatic display, Song reveals his masculine body to Gallimard, who is horrified by the sight. Unable to accept that Song has actually been lying to him for 20 years, Gallimard commits suicide, as Song watches and smokes a cigarette.