Edgar Hilsenrath, a German Holocaust survivor who chronicled the degradations of the ghettos in one novel and dared to turn genocide into satire in another, selling millions of copies and defying critics who said he was too funny, too gruesome and too vulgar, died Dec. 30 at a hospital in Wittlich, Germany. He was 92.

The cause was pneumonia, according to an obituary published on Mr. Hilsenrath’s website by his manager, Ken Kubota.

Laconic in interviews, wearing a black beret and often shrouded in cigarette smoke, Mr. Hilsenrath was a best-selling writer whose books were widely translated — his most celebrated, “The Nazi and the Barber” (1971), was a black comedy told from the perspective of an SS officer — and often drew on his childhood in Hitler’s Germany, adolescence in a Romanian shtetl and war years in a Ukrainian ghetto.

While other works sought to find some higher meaning or lesson in the Holocaust, focusing on the determination of its survivors or the heroism of those who sought to help, novels such as “Night” (1964) — Mr. Hilsenrath’s first — focused almost entirely on the suffering and agony of its victims.

Completed while Mr. Hilsenrath was working as a waiter in New York City, “Night” was centered on Ranek, a Jewish man forced to live in a ghetto modeled after the one in Ukraine where Mr. Hilsenrath, his mother and his brother were sent in 1941.

While the Hilsenrath family lived in relative comfort, staying inside the classroom of an old school building, Ranek slept under a table and, to barter for food, used a hammer to pry a gold tooth loose from his dead brother’s jaw. Other ghetto prisoners were forced to eat garbage.

Asked why his book’s unlucky hero was a member of the ghetto’s lowest social class, rather than a more autobiographical version of himself, Mr. Hilsenrath told Der Spiegel it may have been “because I had a guilty conscience.” He added, “I felt guilty because I survived.”

Notable deaths in 2018 and 2019: Nipsey Hussle, George H.W. Bush, Stan Lee, John McCain, Aretha Franklin and other famous faces we’ve lost

Nipsey Hussle, a Grammy nominated rapper who sought to revive South Los Angeles, died at age 33 on March 31. Read the obituary (Matt Winkelmeyer/Getty Images for Warner Music)

Mr. Hilsenrath’s novel also featured Jewish characters who rape and brutalize women in the ghetto — a dark shading that generated controversy in West Germany, where, Mr. Hilsenrath noted, most contemporary novels about the Holocaust idealized its Jewish victims. “The Jews in the ghetto,” he told Der Spiegel, “were every bit as imperfect as human beings anywhere else.”

“Hilsenrath’s priority is the plight of the oppressed,” German scholar Dagmar C.G. Lorenz wrote in “The Routledge Encyclopedia of Jewish Writers of the 20th Century.” “Disregarding official versions of history he explores aspects of domination: lust, sexual gratification and greed, all merging into the ecstasy of power. Few other writers have so candidly exposed the ties between sadism, politics, war and genocide.”

His follow-up was “The Nazi and the Barber” (1971), about Max Schulz, a Nazi war criminal who escapes prosecution by adopting the identity of one of his concentration-camp victims — a Jewish friend from his childhood — and moves to Israel to become a war hero and hair dresser. In a closing scene, he confronts God, declaring that inaction from the divine was partly responsible for the Holocaust. The scene was deleted from the German-language edition, according to Kubota, because Mr. Hilsenrath did not want it to seem as though he was absolving the German people of guilt.

Sixty German publishers initially refused to publish the novel, which was originally released by Doubleday and published in the original German in 1977. The book received a critical boost from Nobel Prize-winning writer Heinrich Böll, who praised its “gloomy and quiet poetry,” while noting that he had to overcome a “threshold of disgust.”

It was, Mr. Hilsenrath said, a typical problem with his novels, which later included “The Story of the Last Thought” (1989), an alternately humorous and despairing account of the Armenian genocide, in which some 1.5 million Armenians were murdered in the Ottoman Empire during World War I.

“Sensitive readers do have problems with my books,” Mr. Hilsenrath told Der Spiegel in 2005, recalling a time in which he sent a copy of his Armenian novel to a friend. “She called me a bit later and was totally horrified. She had just read the part about the 97-year-old man that sleeps with a Kurdish 9-year-old girl and said she could not go on reading the book. That’s how it is with my books.”

Edgar Hilsenrath was born in Leipzig on April 2, 1926, and raised in the nearby city of Halle, along the Saale River. As anti-Semitic attacks escalated in Germany, the family decided to flee. In 1938, Mr. Hilsenrath’s father, a furrier, told the family he would eventually meet them in Paris. His mother took Mr. Hilsenrath and his brother to her native Romania, where they lived in the town of Siret, just across the border from Ukraine.

In 1941 the family was deported, taken by cattle truck to a ghetto in Mogilev-Podolsk, Ukraine. Defying the rules of the ghetto, they sewed jewelry and other valuables into their clothing, then traded them for food with nearby farmers. Mr. Hilsenrath told the reference work Contemporary Authors that he once attempted to escape but was captured and received a death sentence. He said he “stood facing the firing squad for about 10 minutes” before “the order to shoot was rescinded.”

By late 1944, the ghetto was liberated by the Soviet Red Army, and Mr. Hilsenrath made his way back to Siret, where a group of Zionists from Bucharest invited him to settle what was then British-controlled Palestine. He lived there for several years before moving to France, where he reunited with his father and the rest of the family, determined to become a writer.

His idiosyncratic brand of gallows humor was developed after the war, he once told German radio, “because it was the only way to deal with all the bad memories.”

Mr. Hilsenrath moved to New York in 1951 and returned to Germany in 1975, around the time the country was experiencing a rash of anti-Semitic attacks and demonstrations. One reading by Mr. Hilsenrath in West Berlin was interrupted by a group of 15 Nazis with air pistols and bike chains, who told the audience to leave if they did not want to get hurt.

“The following evening,” the Sydney Morning Herald reported at the time, “when Mr. Hilsenrath was about to hold another public reading from his works, 20 young thugs waited for him and threatened to beat him up if he went ahead with the meeting. He transferred the reading to a private home.”

His wife Marianne predeceased him. Survivors include his second wife, Marlene Hilsenrath, whom he met at a symposium on his work.

In 2016, Mr. Hilsenrath was honored with the Hilde Domin Prize, awarded by the city of Heidelberg to a German writer who addresses the subject of exile.

“His novels, which are driven by bleak, dark powers of imagination, are attempts to find ways to speak of the horrific acts humans commit against each other through various forms of the grotesque,” the prize jury said. “His stories are best symbolized as laughter that gets caught in your throat — somewhere between cynicism, sorrow and assertiveness.”

Correction: An earlier version of this obituary incorrectly referred to Mr. Hilsenrath’s hometown of Halle. The city is not also known as Saale, although it is located along the Saale River and is formally known as Halle (Saale). The story has been updated.