Jorge Semprun, a Spanish-born author who drew from experiences as an anti-fascist resistance fighter, concentration camp inmate and exiled intellectual to write several acclaimed books about the Holocaust and screenplays, including the gripping political thriller “Z,” died June 7 at his home in Paris. He was 87, and no cause of death was reported.

An urbane and witty man, and sometimes maddeningly elliptical writer, Mr. Semprun combined politics and literature in a deeply personal way. He came from a distinguished family of Spanish lawyers and politicians, including a former prime minister. The family left for France during the Spanish Civil War of the late 1930s that brought fascist dictator Francisco Franco to power.

Mr. Semprun remained in France much of his life. He spoke uneasily of having a dual national identity. “Sometimes,” he said, “I feel a little schizophrenic.”

His life became one of fractured political relationships. As a young man, he was a resistance fighter against Franco and against the Germans during their occupation of Paris.

After the war, he became a daring operative in the Spanish and French communist parties; his successor in Spain was caught, tortured and executed. But when news spread of the Stalinist show trials and other violent purges of the early 1950s, he began to feel more like a dissident from party orthodoxy. Framing himself as a humanist and realist, he said he was expelled in 1964 for deviating too far from the party line.

Jorge Semprun said his experience as a prisoner in the Buchenwald concentration camp at first deadened his desire to write. (MIGUEL MEDINA/AGENCE FRANCE-PRESSE VIA GETTY IMAGES)

Remaining committed to left-wing politics, he channeled his literary talents into Oscar-nominated screenplays, including director Constantin Costa-Gavras’s “Z” (1969) and director Alain Resnais’s 1966 drama “La guerre est finie” (The War Is Over), the second of which starred Yves Montand as a courier in the Spanish communist underground.

By far the more enduring film, “Z” starred Montand as a pacifist leader whose assassination is covered up by the totalitarian Greek junta then in power. Film critic Pauline Kael called “Z,” which was based on a novel by Greek writer and diplomat Vasilis Vasilikos, “one of the fastest, most exciting melodramas ever made.”

In recent years, Mr. Semprun had received prestigious literary awards in Europe and Israel for championing individual freedom of expression. Peruvian author and Nobel laureate Mario Vargas Llosa wrote a tribute to Mr. Semprun in the Spanish newspaper El Pais that noted, “like Albert Camus, his was a literature filled with great moral preoccupation.”

Prime Minister Jose Luis Rodriguez Zapatero of Spain called Mr. Semprun “an intellectual committed to the dignity of man.” The earlier socialist government of Felipe Gonzalez had hired Mr. Semprun as its culture minister in the late 1980s and early 1990s, and his return to Spain was widely viewed as a moment of absolution for the writer.

For years, he had been persona non grata in his homeland after his bestselling 1977 memoir, “The Autobiography of Federico Sanchez,” cast doubt on the extent to which the Socialist Party had broken with its Stalinist roots. The title referred to Mr. Semprun’s pseudonym while serving as a clandestine organizer for the party, which had been outlawed during Franco’s decades in power.

Although written as a memoir, it was initially marketed in Spain as fiction because of political sensitivities after Franco’s death in 1975. The book drew lavish international praise for its powerful insider’s account of a political party coming to grips with de-Stalinization.

Jorge Semprun Maura was born in Madrid on Dec. 10, 1923. After his family moved to France, he dedicated himself to French underground guerilla forces fighting the Germans.

Captured by the Gestapo in 1943, he was sent to the Buchenwald concentration camp in Germany for the remainder of the war. He attributed his survival to having obtained a desk job through his fluency in German — thanks to a German nanny from childhood — and influential connections in the underground.

Once liberated from Buchenwald by the Americans, he found himself too emotionally deadened to pursue a longheld interest in writing.

“For the first 17 years of my life, I never doubted that I was a writer, even though I’d written nothing — just the usual youthful fragments,” he later told the London Independent. “And then, what was I going to write if not about Buchenwald? Some little romantic novel, about first love or rites of passage? [Holocaust survivor and author] Primo Levi said that in writing one is liberated and returns to life, whereas I didn’t return to life but remained locked in death.”

Mr. Semprun initially thought that his involvement in politics was the way forward. Then, once expelled from the communist party, he turned full time to writing books and screenplays.

He worked again with Resnais, on the French political drama “Stavisky” (1974), but was better known for his collaboration with Costa-Gavras, which included stinging indictments of fascism including “The Confession” (1970), about the Stalin-sponsored show trials in Czechoslovakia, and “State of Siege” (1975), a political kidnapping drama set in Latin America. Both Costa-Gavras films starred Montand.

Mr. Semprun’s early marriage, to French actress and playwright Loleh Bellon, ended in divorce; a son from that marriage died. Mr. Semprun later married Colette Leloup, who died in 2007. Survivors include five children from that marriage.

In addition to his films, Mr. Semprun made significant contributions to Holocaust literature. His first book, “Le Grand Voyage,” published in France in 1964, was a fictionalized account of his journey by train to Buchenwald.

After it was translated decades later into English as “The Long Voyage” and “The Cattle Truck,” critic Amanda Hopkinson, writing in the New Statesman, called Mr. Semprun’s work “essential reading.”

Mr. Semprun’s other books included “Quel Beau Dimanche (What a Beautiful Sunday!),” a novel set at Buchenwald that flashes backward and forward in time and that was influenced by Alexander I. Solzhenitsyn’s novel “One Day in the Life of Ivan Denisovitch.”

In his highly praised 1994 book “L’Ecriture ou la Vie (Literature or Life),” Mr. Semprun wrote about the struggle of describing the Holocaust — how to put the unimaginable horrors into words.

Art, and especially literature, he later told an Israeli reporter, “can transform culture, and through this process, society. Only minimally, of course. It’s obvious that it is wars, revolutions and big capital that really make the crucial differences. Literature is not a privileged activity separated and alienated from the real world. Even the most abstract writers still somehow bear witness to reality.”