Arpad Goncz, who survived a communist-era life sentence to become Hungary's first democratically chosen president, has died aged 93.
Parliament deputy speaker Istvan Hiller announced the death to politicians, adding: "He was a legend already during his lifetime."
Politicians stood for a minute of silence in honour of his memory.
Mr Goncz was charged with treason and sentenced to life in prison by Hungary's communist authorities for taking part in the abortive anti-Soviet uprising of 1956.
He was released in 1963 under a general amnesty aimed at easing tensions with the West.
Mr Goncz was elected to a five-year term by the parliament after free elections that ended four decades of communist rule in 1990, and was later re-elected by parliament for a further five years.
Though his post was largely ceremonial, Mr Goncz was credited by many with deftly using his limited powers to enforce Hungary's fledgling democratic constitution, often putting him at odds with the post-communist government.
Although he lacked the Bohemian glamour of fellow dissident-turned-president Vaclav Havel in the Czech Republic, Mr Goncz's fatherly manner endeared him to many Hungarians, winning him the moniker Uncle Arpi.
Born on February 10 1922 in Budapest, he earned a law degree in 1944 and also studied agronomy.
As the Second World War drew to a close, Mr Goncz was called up to fight for Hungary - then allied to Nazi Germany - but escaped from his unit and joined the anti-Nazi resistance.
He remained politically active during the turmoil that followed the war, becoming secretary of the populist Independent Smallholders Party. The party scored a landslide victory in the first postwar elections, but it was never able to govern effectively as the communists steadily usurped power, finally eliminating all opposition in rigged elections in 1948.
Mr Goncz worked as a locksmith and an agronomist until running foul of the communists for political activities in support of the 1956 uprising.
In the years after his release from prison he worked as a translator and playwright, resuming political activity in 1988 as a co-founder of the liberal Alliance of Free Democrats.
The party finished second to the conservative Hungarian Democratic Forum in the 1990 elections, but Mr Goncz became president in a compromise between the rival parties.
Once in office, Mr Goncz often blocked government appointments and legislation as relations soured between the liberals and the conservative coalition led by Jozsef Antall.
The most prominent case was his repeated refusal to dismiss the heads of state radio and television as the government, with its popularity waning, tried to tighten its grip on the media.
That earned him the praise of press freedom advocates, but drew wrath from right-wing nationalists who accused him of overstepping his powers and being a puppet of Jewish and Western interests.
After Ferenc Madl, a conservative, replaced him as president in 2000, Mr Goncz stepped out of the limelight, devoting himself mainly to charitable causes.
He is survived by his wife, Maria Zsuzsanna, and four children, including daughter Kinga, a former foreign minister.