Hungary's first democratically elected president, Arpad Goncz, has died aged 93.
Mr Goncz was jailed for taking part in the anti-Soviet uprising of 1956, but was released in 1963.
He was elected by the parliament twice, in 1990 and 1995, and was credited with helping enforce the fledgling democratic constitution.
His fatherly manner endeared him to Hungarians, who nicknamed him "Uncle Arpi".
Mr Goncz joined the resistance against the Nazis during World War Two and then became secretary of the Independent Smallholders Party, which won the first post-war election but was unable to prevent the communists from later taking control.
He was jailed for life on treason charges for involvement in the abortive uprising of 1956, but was released in 1963 under an amnesty aimed at easing tensions with the West.
Mr Goncz then worked as a translator and playwright until 1988, when he returned to politics, co-founding the liberal Alliance of Free Democrats, and - like fellow dissident Vaclav Havel in the Czech Republic - became his country's first democratically elected president.
Once in office, he refused to dismiss the heads of state radio and TV as an increasingly unpopular government tried to tighten its grip on the media - drawing praise from press freedom advocates but prompting nationalists to accuse him of being a Western puppet.
Mr Goncz left the presidency in 2000 and devoted himself to charitable work. He is survived by his wife, Maria Zsuzsanna, and four children including daughter Kinga, a former foreign minister.