Ivan Klima, the Czech novelist whose survival of two totalitarian regimes — one Nazi, the other communist — made him one of Eastern Europe’s most perceptive distillers of the human condition under authoritarianism, died on Oct. 4 at his home in Prague. A writer of more than 40 books, also a dissident, teacher and critic, Mr. Klima was deeply affected by an early experience in his life: incarceration as a boy by the Nazis at Terezin concentration camp, north of Prague. While living there from 1941-1945, he faced the daily prospect of being transported to Auschwitz. Some of his most memorable short stories and novels touched on the horror of those years.

His writing also dwelled on the communist era, including the aftermath of the Prague Spring in 1968. Their optimism was thwarted when the Soviets sent an estimated 750,000 Warsaw Pact troops to suppress the Prague reforms later that year.

While his work is suffused with angst, it is also offset, Mr. Klima once said, by an underlying optimism. “My books may seem somewhat depressing,” he said, “but they always offer a little hope. I could not write a book without hope.”