Former prime minister Giulio Andreotti of Italy, one of the most powerful figures in his country’s politics after World War II, died May 6 at his home in Rome. He was 94.

The immediate cause was unclear. The Italian daily Corriere della Sera reported that he was hospitalized last year for a respiratory ailment.

Students of Italian politics ranked Mr. Andreotti as one of the most prominent leaders in an often-turbulent era from the fall of Fascist dictator Benito Mussolini to the rise of Silvio Berlusconi.

A stooped, cerebral and often ironic man, Mr. Andreotti stood out in Italy’s government for more than four decades, serving seven times as prime minister between 1972 and 1992. At the height of his career, his power in Rome was said to be second only to that of the pope. He was sometimes called Il Divo — “the divine one.” Critics called him Beelzebub.

Raised in poverty, Mr. Andreotti was essentially plucked from youthful obscurity by Alcide De Gasperi, the founder of the Christian Democratic Party who became prime minister shortly after World War II.

Giulio Andreotti, shown here in 1976, was one of the most powerful figures in Italy’s postwar politics. (AFP/GETTY IMAGES)

He became De Gasperi’s confidant for years and served in succeeding governments as interior, finance, treasury, defense, commerce and foreign minister. Mr. Andreotti was credited with helping lead Italy from the wreckage of World War II to membership in the modern European and world communities.

Over his years in office, Mr. Andreotti faced daunting crises of inflation, unemployment and, at a time of extreme rancor in Italian politics, political terrorism.

As prime minister, Mr. Andreotti crafted often fragile alliances to keep the Christian Democrats in power. He was known for his efforts to limit the influence in Italian politics of the Communist Party.

At one point, he was said to have accepted Communist support in a move to ensure his party’s continued control of the fractious Italian government. The historic compromise, however, proved highly controversial and was regarded as contributing to dangerous instability.

Mr. Andreotti was prime minister in 1978 when Aldo Moro, a Christian Democrat and former prime minister, was kidnapped by the left-wing Red Brigades. Mr. Andreotti refused to negotiate with the kidnappers, and Moro was ultimately found dead in the trunk of a car in Rome.

In the 1990s, Mr. Andreotti became entangled in a series of high-profile corruption and Mafia investigations. Those investigations brought about the dissolution of the Christian Democratic Party. The inquiries revamped Italian politics but jeopardized Mr. Andreotti’s image.

By that time, Mr. Andreotti had been declared a senator for life. He was stripped of his senatorial immunity so that legal action could be pursued against him, and there were two separate, years-long investigations involving his alleged connections to the Mafia.

After he was put on trial in the 1990s, Mr. Andreotti said he wanted to “live long enough to see the truth triumph.”

In one case, prosecutors charged that Mr. Andreotti had conspired with the Mafia in the 1979 murder of Mino Pecorelli, a hard-driving investigative journalist. Mr. Andreotti was acquitted in 1999.

Later that year, in a separate trial, he was acquitted of trading favors with the Mafia.

That trial had been particularly sensational and included memorable testimony in which it was claimed that Mr. Andreotti had exchanged the kiss of honor with a mob boss. Mr. Andreotti’s supporters angrily protested prosecutors’ reliance on what the backers considered dubious testimony by Mafia turncoats.

In an interview conducted during the investigations, The Washington Post asked Mr. Andreotti how he felt about his career and its dramatic changes of fortune.

“ ‘Bitter,’ ” he said, “is the most exact term.”

Giulio Andreotti was born Jan. 14, 1919, in Rome. His father, a teacher, died shortly after his birth.

During World War II, Mr. Andreotti was turned away from combat duty for medical reasons. He became a medical orderly and also pursued a law degree at the University of Rome. (Years later, when he became defense minister, critics challenged his failure to serve. “I’m especially qualified,” Mr. Andreotti responded, according to the New York Times, “because during the war I saved lives instead of taking them.”)

He became a leader in the Catholic student movement and met De Gasperi at the Vatican library, where the Christian Democratic Party leader worked while waiting out the end of the Fascist regime. Mr. Andreotti at the time was researching the papal navy.

“Don’t you have anything better to do?” De Gasperi demanded, according to an account in the Times. Noting Mr. Andreotti’s intellect, De Gasperi recruited him into politics.

After the war, Mr. Andreotti played a role in drafting a new constitution. Traumatized by the experience of the Fascist regime, the framers wrote a document intended to prevent any party from holding too much power.

However, while avoiding the dangers of totalitarianism, the constitution failed to protect Italy from the hazards of political instability.

Mr. Andreotti’s survivors include his wife, Livia Danese; four children; and several grandchildren. He was the subject of Paolo Sorrentino’s 2008 film “Il Divo” and wrote a number of books, including a biography of De Gasperi.

Mr. Andreotti was a student of Cicero, the Roman orator and politician of classical antiquity who was a veteran of historic power struggles of his own.

Mr. Andreotti’s survival into his tenth decade appeared to bear out a statement he had made years ago. “Power,” he said, “wears out only those who don’t have it.”