There is only one hopeful scene in "Different from the Others," a silent picture from 1919 that is widely considered the first feature film about gay love. In it, a gaunt, handsome man plays the piano in his Berlin drawing room. He is Paul Körner, a violin virtuoso, and, in his silk housecoat, surrounded by heavy drapery and Grecian statuettes, he appears to live a life that is resplendent but lonely. Then an unlikely event sets him on a new course: a young music student has come calling. Kurt Sivers, round-faced, excitable, has seen all of Paul’s concerts, and he approaches the master nervously, hands clutched to his chest. “My deepest wish would come true if you were willing to be my teacher!” an intertitle reads. Paul responds by offering Kurt his great open palm. Their alliance, a perfect meeting of passion and pedagogy, seems indivisibly strong—but, by the end of the film, we have learned that it is otherwise, owing to the self-hatred and cruelty that homosexual love can inspire, even in Weimar Berlin.

"Different from the Others," which was written by the gay sexologist Magnus Hirschfeld and the Austrian director Richard Oswald, tells the story of one who “suffers not from his condition, but rather from the false judgment of it,” as another intertitle reads. By 1933, when the Nazis stormed Hirschfield’s Institute of Sexual Research, also in Berlin, every known copy of the film had been destroyed. Luckily, the good doctor had included some forty minutes of the footage in a long scientific film called “Laws of Love,” which was shown in Russia in the late twenties or early thirties and remained for decades in the Krasnogorsk archives. In the eighties, film restorers began trying to piece together the original, but it wasn’t until this winter—six years after the U.C.L.A. Film & Television Archive bought a 35-mm. print of “Laws of Love”—that a reliable version of “Different from the Others” was completed, using detailed Nazi censorship records as a narrative guide, and with images substituted for the missing scenes. “Years before Alfred Kinsey, Hirschfeld was arguing that homosexuality exists on a continuum,” Jan-Christopher Horak, the director of the U.C.L.A. archive, told me. “It’s not abnormal, because there is no abnormality.”

The film makes another argument: that hatred can fester even in the interstices of liberal democracies. On the surface, tolerance prevailed in Weimar Germany. If you were careful enough, you could evade the shadow of Paragraph 175, an infamous law that forbade “unnatural fornication, whether between persons of the male sex or of humans with beasts.” And it was relaxed censorship laws that allowed “Different from the Others” to be made in the first place, along with later gay-themed films such as “Pandora’s Box” (1929), whose seductive countess was one of the first onscreen lesbians, and “Mädchen in Uniform” (1931), which takes place in a brutal, erotically charged all-girls boarding school. Weimar night life was infamously decadent: men dressed as women flocked to the Silhouette; women dressed as men favored the Mikado; and the Eldorado drew gender-benders of all types. When Anita Loos, who wrote the novel “Gentlemen Prefer Blondes,” visited the city in the twenties, she observed that “any Berlin lady of the evening might turn out to be a man; the prettiest girl on the street was Conrad Veidt”—the silent-screen leading man who played none other than Paul Körner in “Different from the Others.”

Yet there is a special kind of shame and suffering that comes from living life half-openly, from knowing what it is you’re not really allowed to have. In "Different from the Others," we watch as Paul loses his faith in the power of companionship. In a flashback to his years as a boarding-school teen-ager, he looks over a text with his roommate, Max, and drapes his arm around the younger boy. Then a teacher walks in and bursts into outrage: Max is supposed to be doing his assignment alone—the standard punishment, it would seem, for untoward tendencies. "As a university student, Körner led a lonely and reclusive life, devoted only to his studies,” an intertitle then tells us. We see him reading as five classmates sneak up behind him, raising their hands in unison and clapping them down on his shoulders—a threat of future violence delivered in the guise of friendship. “The girls are making fun of you because no one ever sees you,” they say, inviting him to a bordello, where two women in lace gowns try to kiss him. “If that boy’s completely normal, then I’m a virgin,” the madam says—the kind of comment that moves Paul to seek a cure from a hypnotist, the conversion therapist of the day.

It is not the state that is responsible for Körner’s downfall, at least not directly: in keeping with the subterranean hatred of Weimar Berlin, convictions under the anti-sodomy law often began with extortionists who operated within the demimonde itself. The villain of “Different from the Others” is the smirking Franz Bollek, played by the well-known film star Reinhold Schünzel, who passes Kurt and Paul on a wooded path in a city park. “Handsome lad,” Bollek says, glaring at Kurt, as Paul starts with recognition: years before, Paul had been blackmailed by Bollek after meeting him at a masquerade. (A scene from that party, showing an androgynous conga line, was considered one of the film’s controversial images.)

Now Bollek decides to resume his crime. On the very day Kurt performs in a concert alongside Paul, they find Bollek prowling around in Paul’s living room. “Don't get so excited," Bollek tells Kurt, when he tries to brawl. “You’re getting paid by him, too!” Kurt is not a whore, of course, but the mere suggestion, and Paul’s familiarity with Bollek, is enough to send him running: "I am determined to make my way alone," Kurt writes to his sister. Paul, meanwhile, refuses another demand for payment; Bollek turns him in to the police, and he is sentenced to a week in prison. He does not need to serve his term to be publicly shamed and professionally ruined: we watch him swallow a few capsules of cyanide and sink into his chair. His eyes narrow and widen; his face tightens and slackens; his head lolls back and he dies.

Bad laws can destroy good relationships—perhaps especially when they’re poorly enforced, leaving just enough space for human bonds to form. At the end of "Different from the Others," we're told of a missing sequence in which a great hand descends over a German law book to cross out the entry for Paragraph 175. It is fitting that the scene was lost, because the law prevailed for many decades to come. The Nazis used it to send some forty-six thousand men to prison and perhaps ten thousand of those to concentration camps. Upon liberation, most of the survivors were promptly locked up again, whether by East or West Germany, both of which continued to enforce Paragraph 175 through about 1970. It was not until 1994 that the law was formally repealed, and it was not until last year that reparations were paid to the few thousand victims who were still living.

Today we continue to live in the slipstream of provisions like Paragraph 175. Similar laws are still in force in dozens of countries; in the United States, anti-sodomy statutes were ruled unconstitutional in 2003, but they remain on the books in upward of ten mostly deep-red states, and activists have been stymied in their push for formal repeal. Love trumps hate, the signs tell us, or, as Magnus Hirschfield said in 1919, at the Berlin première of “Different from the Others,” “Soon the day will come when science will win a victory over error, justice a victory over injustice, and human love a victory over human hatred and ignorance.” That day is still ahead of us.