Mário Soares, who fought from jail and in exile against Portugal’s entrenched autocratic regime and whose principled approach as prime minister and later president made him the father of modern Portuguese democracy, died Saturday at a Lisbon hospital. He was 92.

His death was announced by Portugal’s Socialist Party, which he led. The cause was not disclosed.

Mr. Soares was the most significant Portuguese political figure of the past half-century, as his country emerged from a repressive dictatorship in the 1970s and began to embrace democratic ideals.

He was arrested a dozen times and endured periods of exile without standing trial — as his father had before him — while waging a sometimes-lonely campaign against the one-man rule of António de Oliveira Salazar, who controlled Portugal from 1932 until 1968, when he was debilitated by a stroke.

The remnants of Salazar’s regime were finally toppled in 1974 in a largely peaceful military coup known as the “Carnation Revolution,” after flowers were placed in the barrels of soldiers’ rifles.

Mario Soares in Lisbon in 1974. (AFP/Getty Images)

Returned from exile in France, Mr. Soares made a triumphant return to Lisbon, where he was greeted by thousands of cheering supporters. He then set about restoring democracy to a country whose last civilian head of state had been forced out in 1926.

After the 1974 coup, Mr. Soares became foreign minister in a government led by moderate factions of the Portuguese military. Within a year, he dismantled his country’s treasury-draining group of African colonies, including Angola, Mozambique and present-day Guinea-Bissau.

There was little hope, however, that he or anyone else could guide Portugal back into the western cultural and political mainstream. U.S. diplomatic leaders, including then-Secretary of State Henry Kissinger, feared Portugal would become either a Soviet satellite on the Iberian peninsula or another military dictatorship.

“The Portuguese wonder whether the American people approve the policy of support for dictatorships,” Mr. Soares wrote in 1972. “Washington is mistaken if it believes that such a policy will foster a liberal evolution. The very opposite occurs: the dictatorship becomes tougher and surer of itself; the situation then becomes explosive as the moderate opposition turns radical.”

Kissinger reportedly offered to help find Mr. Soares an academic appointment in the United States to avoid a fate of exile — or worse. But Mr. Soares was determined to bring reform to Portugal, which was beset by a host of economic and social problems and was among the poorest countries in Europe.

During his years in France, Mr. Soares helped organize Portugal’s Socialist Party, with a center-left approach not unlike those of parties led by Willy Brandt in West Germany, Olof Palme in Sweden and Mr. Soares’s close friend François Mitterrand in France.

He called himself a socialist, but Mr. Soares was no Marxist. He opposed totalitarian tendencies by hard-liners of any stripe.

Mario Soares, right, with U.S. President Ronald Reagan in Lisbon in 1985. (Luis Vasconcelos/EPA)

“The preaching of Communist doctrine was no revelation, nor did it delude me,” he said.

Some of his fiercest political enemies were members of Portugal’s Stalinist-leaning Communist Party. In 1975, Mr. Soares demanded the resignation of the country’s prime minister, Vasco Goncalves, concerned that his strong ties to the Communist Party could plunge Portugal back into an authoritarian state.

The following year, Mr. Soares ran for the office of prime minister himself. He campaigned with his daughter serving as his driver and bodyguard.

“What we believe in is socialism in liberty,” he said, “neither dictatorship of the left nor dictatorship of the right.”

After winning a plurality of the vote, Mr. Soares moved to strengthen ties with the United States and Western Europe and thwarted yet another attempted Communist military coup.

“If the coup had succeeded,” he told the New York Times, “I would have been dead or in jail or back in exile, so I’m glad it didn’t.”

He was in office for just 500 days. His government lost a vote of confidence in the parliament, in part because Mr. Soares refused to compromise with the Communists.

Portugal struggled through economic and political chaos during the next few years, until Mr. Soares returned to office as prime minister in 1983. He was succeeded two years later by the popular centrist Aníbal Cavaco Silva, as Portugal began to attain newfound stability.

In 1986, Mr. Soares was elected the country’s first civilian president in 60 years. He was instrumental in engineering Portugal’s entry into what is now the European Union and took a larger role on the international stage.

He was called on to help settle conflicts in the Middle East and across Latin America. He was, among other things, a friend of both Palestinian leader Yasser Arafat and former Israeli prime minister Yitzhak Rabin.

In 1991, Mr. Soares was reelected to a second five-year term as Portugal’s president, a largely ceremonial position. He later served in the European Parliament and in 2006 failed in a third bid for Portuguese president.

By then, however, his country had undergone an economic revival, and the democratic ideals he had advocated since his youth were firmly in place.

Mário Alberto Nobre Lopes Soares was born Dec. 7, 1924, in Lisbon. His father was a cabinet minister in Portugal’s First Republic, which lasted from 1910 to 1926. He later founded a private school in Lisbon.

The younger Mr. Soares was first jailed in the 1940s while studying at the University of Lisbon. He and his wife, actress Maria Barroso, were married at a Portuguese prison in 1949, while he was he was jailed for subversion.

After an oft-interrupted academic career, he graduated from the University of Lisbon in 1951, earning a law degree there in 1957 and later studying law at the Sorbonne in Paris. He opened a law office in Lisbon.

Often harassed for his political views, he was exiled in the 1960s to the remote Portuguese colony of São Tomé off the west coast of Africa. Mr. Soares was invited back to Portugal after Salazar, the longtime dictator, fell into a coma in 1968. Within two years, however, Mr. Soares fled to France, where he taught in various universities.

His wife died in 2015. Survivors include two children, Maria Isabel Soares and João Soares, a former mayor of Lisbon.

Mr. Soares was a noted bon vivant and bibliophile, with a taste for scotch and a personal library of more than 10,000 volumes.

The proper goal of any government, he said after being elected president in 1986, is to “concentrate our energies on the fight to eradicate poverty, ignorance and intolerance.”