Hungarian President Arpad Goncz, left, meets Pope John Paul II in 2000 during a private audience at the Vatican. (Plinio Lepri/AP)

Arpad Goncz, a Hungarian writer and translator who battled Nazism and communism and went on to become the country’s first president after the fall of the Iron Curtain, has died. He was 93.

An aide confirmed the death but did not provide further details.

Mr. Goncz was elected by lawmakers as Hungary’s president in 1990, following four decades of communist rule, and held the largely ceremonial post until 2000.

Like Vaclav Havel, his Czech counterpart who served 13 years as president after the 1989 Velvet Revolution, Mr. Goncz fought a totalitarian regime and spent time in communist prisons. Both writers, who were friends, became heads of state as Eastern Europe embarked on the transition to democracy. Havel died in 2011.

Mr. Goncz translated Havel’s writings into Hungarian as well as J.R.R. Tolkien’s “The Lord of the Rings” trilogy and the works of William Golding, John Updike, Ernest Hemingway, Agatha Christie and William Faulkner. He also translated George H.W. Bush’s 1988 biography “Looking Forward.”

“Under dictatorship, it is only the writer and the artist who preserve understanding of the human dimension,” Mr. Goncz told the Baltimore Sun in 1990. “Those who are making politics are not really experts or engineers of human problems, but only what you might call skilled laborers.”

Arpad Goncz was born in Budapest on Feb. 10, 1922. He graduated in law from Budapest’s Pazmany Peter University in 1944, while Nazi and Soviet troops battled for control of Hungary, which was an ally of Adolf Hitler’s regime during World War II.

Mr. Goncz was conscripted as a soldier in 1944 and deserted his unit the same year, joining an armed student-resistance movement fighting the Nazis, according to a biography on the Web site of the Arpad Goncz Foundation. He was shot in the leg in 1944 after a botched mission on the outskirts of Budapest. Later, as the Nazis retreated, Mr. Goncz was detained by Soviet troops.

He became a leader in the Independent Smallholders’ Party after the war before working as a laborer and welder when the government disbanded opposition parties in the late 1940s.

Mr. Goncz was sentenced to life in prison after the failed 1956 uprising against Soviet rule. Learning English as an inmate, he took part in a prison hunger strike in 1960 and was freed as part of a general amnesty three years later. Mr. Goncz then worked as a technical translator for a chemical research institute and became a freelance writer.

In the late 1980s, Mr. Goncz helped establish the Alliance of Free Democrats, a party that opposed the communist regime and helped broker a peaceful transition to democracy. After he served as acting president for three months, the Hungarian parliament elected him president in August 1990. He was reelected in 1995.

Mr. Goncz was married to Maria Zsuzsanna Gonter and had four children. His daughter Kinga, a member of the Hungarian Socialist Party, was the nation’s first female foreign minister and served in the post from 2006 until 2009. She later represented Hungary in the European Parliament.

— Bloomberg News