In the 1988 Broadway play and the 1993 film “M. Butterfly,” Bernard Boursicot was depicted as a high-ranking diplomat and Shi Pei Pu as a beautiful female opera singer who met in 1964. In fact, Mr. Boursicot was a 20-year-old high school dropout who had finagled a job as an accountant at the newly opened French Embassy in Beijing. His few sexual experiences had been with male schoolmates, and he was determined to fall in love with a woman, he wrote in his diary.  Shi Pei Pu was 26 when they met, delicate and charming. He lived as a man and taught Chinese to the diplomatic wives. He told Mr. Boursicot that he had been a singer and a librettist in the Beijing Opera. One perfect night in the Forbidden City Mr. Shi told Mr. Boursicot a story no romantic could resist: Mr. Shi said he was a woman who had been forced to go through life as a man, because her father required a son. A short time later, the men became lovers, although the sex, Mr. Boursicot would later say, was fast and furtive, always carried out in the dark.  When the affair was discovered by the Chinese authorities, Mr. Boursicot passed them French documents, first from the embassy in Beijing and later from his posting at the consulate in Ulan Bator, Mongolia.  Mr. Boursicot spent most of his life outside China and was romantically involved with men and women. On his rare visits to Shi Pei Pu, sexual contact was circumscribed. On one visit, Mr. Shi presented him with a 4-year-old boy, Shi Du Du, who Mr. Shi said was their son.  In 1982, Mr. Boursicot — then living openly with a male companion, Thierry Toulet — was able to arrange for Shi Pei Pu and Shi Du Du to live with him in Paris. Shortly thereafter, Mr. Boursicot and Shi Pei Pu were arrested. Mr. Shi first told the police he was a woman, but he admitted the truth to prison doctors, showing them how he hid his genitals.  Shi Du Du explained the mystery of where he came from in his statement to the police: he was from China’s Uighur minority, he said, and had been sold by his mother. “It was not that my mother did not love me,” he said. ”We were starving.”  Mr. Boursicot, hearing that Shi Pei Pu was a man and always had been, sliced his throat with a razor blade in prison.  In 1986, Mr. Shi and Mr. Boursicot received six-year sentences for espionage. They were pardoned a year later. Mr. Shi is survived by Shi Du Du, who lives in Paris and who, Mr. Boursicot said, has three young sons.  Although Mr. Boursicot and Mr. Shi occasionally spoke over the years, relations were strained. Mr. Boursicot said that they last spoke a few months ago and that Mr. Shi told him he still loved him.  Mr. Shi enjoyed the spotlight, performing in public as an opera singer, but disliked talking about his romance with Mr. Boursicot, particularly the sexual specifics.  “I used to fascinate both men and women,” he said in a rare interview in 1988. “What I was and what they were didn’t matter.”  A version of this article appears in print on , on Page A19 of the National edition with the headline: Shi Pei Pu, 70, Singer, Spy and ‘M. Butterfly’. Order Reprints| Today's Paper|Subscribe
Mr. Shi was a Beijing opera singer and spy whose sexually convoluted love affair with a French Embassy worker was the inspiration for the Broadway show.