In June 1948, novelist Osamu Dazai committed suicide. The 38-year-old, who had just completed his masterpiece, “No Longer Human,” and whose fame was peaking, jumped into Tokyo’s Tamagawa Canal with his mistress, Tomie Yamazaki, and drowned.

With his acid wit and nihilistic vision, Dazai had been the key author who benefitted from the easing of censorship after Japan’s defeat in World War II. He scandalized and fascinated postwar society with his personal lifestyle — fathering children out of wedlock — and the fearless manner in which he depicted nontraditional relationships.

He undermined one of the key tenets of sexuality in modern Japan by suggesting that “romantic love” doesn’t always lead to marriage and happiness.

For Dazai, there was no happiness to be found in “romantic love.” He seemed to be fascinated by the illicit romances — blocked by moral and social constraints during the Edo Period (1603 to 1868) — that resulted in shinju (a “double love suicide”), as depicted by playwright Chikamatsu Monzaemon. For Dazai, the natural destination of love was death itself. No amount of worldly success — and Dazai had plenty — or romance could challenge the novelist’s view that life was utterly pointless. Illicit love merely furnished a partner with whom to make an exit.

As Dazai’s drowned body was recovered, waiting to take his literary position was a 23-year-old writer, Yukio Mishima, determined to bring an iconoclastic hammer down on a different aspect of sexuality: the taboo of same-sex relationships, which emerged after Japan opened itself to the West after the 1868 Meiji Restoration.

Mishima professed a lifelong hatred of Dazai, a visceral dislike that betrayed the enormous debt Mishima owed to him as a writer. In “No Longer Human,” Dazai had brought brutal, shocking honesty to the depiction of heterosexual relationships, and the year after it was published, 1949, Mishima brought the same honesty to the exposure of his own homosexual and sadomasochistic desires. “Confessions of a Mask” includes a description of the narrator’s ejaculation, which occurs while he is transfixed by the arrow-pierced body of St. Sebastian, as depicted in a Guido Reni painting.

Dazai and Mishima opened the doors to a literary revolution, depicting sexuality and relationships with an unprecedented degree of frankness, but this was not accompanied by a sexual revolution — perhaps both writers were too far ahead of their time. The public might have been enthralled to read about shocking deviations from standard morality, but in wider society those norms remained firmly in place. In 1956, an anti-prostitution law was passed in Japan, as though society could be made healthier with a single, supposedly self-improving piece of legislation.

Mishima’s first major novel was a sensational “coming out,” but he promptly stepped back into the closet. His family, with whom he still lived, dismissed his outlandish sexual fantasies as “nonsense” and Mishima was keen to avoid the stigma of being seen as a gay writer. Even with “Forbidden Colors” (1951-53), which includes descriptions of the gay demimonde that had sprung up in Tokyo after the war, Mishima claimed to be merely an observer, not a participant. He would never directly touch the subject again.

In Japan during the 1950s, sexuality was viewed as something that could be molded and, if needed, corrected — it was not seen as a core part of a person’s identity. In the same way that Mishima set out to transform his weedy frame through bodybuilding, he also attempted to transform himself into a man who could enjoy a “normal” married life. After carefully scrutinizing candidates, he married in 1958 and subsequently had two children.

Meanwhile, a new generation of female writers were attempting to analyze the position of women in a society governed by outmoded and often contradictory social norms. This group included Fumiko Enchi, Yuko Tsushima (Dazai’s daughter) and Taeko Kono, who depicted women as trapped in a society that prized them for their “cuteness” and child-like qualities.

Often forced to endure unhappy marriages, Kono’s female protagonists react to the unnaturalness of their social situation by nurturing sadomasochistic complexes. In the 1961 short story “Yoji-gari” (“Toddler Hunting”), a character seeks to impose her will on young male children, and in the 1962 story “Snow,” a woman leaves a child to die in the freezing cold. These stories suggest that Japan itself acts as an unnatural parent to its female population, seeking to replace their innate identity with an androcentric vision of femininity.

Mishima’s subversive legacy continued to be felt decades later. Haruki Murakami’s three early novels, written between 1979 and 1982 — “Kaze no Uta o Kike” (“Hear the Wind Sing”), “1973 no Pinboru” (“Pinball, 1973”) and “Hitsuji o Meguru Boken” (“A Wild Sheep Chase”) — all begin on or make reference to Nov. 25, 1970, the day Mishima stunned Japan with his spectacular ritual suicide. As the novelist’s torturous sexuality left the main stage, ripples of the West’s sexual revolution began to reach Japan. From the 1970s onward, the shifting nature of sexuality in the nation was tackled by writers such as Haruki Murakami and Ryu Murakami.

An important theme in Murakami’s best-selling “Norwegian Wood” (1987) would be both the promiscuity of the post-’60s generation and the underlying spiritual and emotional emptiness that came with that promiscuity.

Meanwhile, Ryu Murakami inhabited the same space as Dazai, flitting between the bar and nightclub world of modern Tokyo and offering a similarly bleak, humorous and jaundiced view of Japan. In his stories, such as “Historia de un Amor” (1997), there is always a kind of “other self” waiting for redemption from their indulgences in sex, drugs and alcohol. The sophistication and explosion of money in the ’80s bubble economy meant that the sadomasochistic fantasies once silently borne by the protagonists of Mishima and Kono could now be fully acted out — like the characters in Murakami’s 1988 short story collection “Topaz” — with prostitutes busy at work in the opulent bedrooms of Tokyo’s New Otani hotel.

In Japan, alternative perspectives on sexuality still struggle for widespread acceptance. In 2013, when a major exhibition of Japanese shunga (erotic paintings and woodblock prints) was held in London, some Japanese were embarrassed to visit; in 2014, Japanese artist Rokudenashiko was arrested for distributing “obscene” 3-D scans of her vagina. The straitjacket of Meiji Era respectability has not loosened much around sexual transgression.

The supposed declining interest in sex in Japan has been much reported, with a survey by the National Institute of Population and Social Security Research published last September claiming that 65 percent of unmarried people between 18-34 were not in a romantic relationship. When asked why, many Japanese young people reportedly said they found sex “mendokusai” (“troublesome”).

Sexuality is indeed complex, but the nation’s modern novelists — from Dazai to Mishima to Kono — offer the best road map to the beguiling maze of sexual identity in Japan.

This is the final installment in a three-part series on sexuality in Japanese literature. Damian Flanagan is the author of “Yukio Mishima” (Reaktion Books, 2014) and “The Tower of London: Tales of Victorian London” (Peter Owen, 2004).