Mohamed Heikal in 2015. (Ahmed Abd El-Latif/AP)

Mohamed Heikal, a confidant of Egypt’s nationalist leader Gamal Abdel Nasser who later wrote insider accounts of his country’s wars and peacemaking deals with Israel, died Feb. 17 in Cairo. He was 92.

State television announced the news. He recently suffered kidney problems that required regular dialysis.

Better known among Egyptians by his full name, Mohamed Hassanein Heikal, the popular author rose to prominence as an adviser and later a Cabinet minister under Nasser, Egypt’s socialist and Arab nationalist president who ruled from 1954 until his sudden death in 1970.

His friendship with Nasser cast Mr. Heikal in the role of a top authority on Egyptian and regional politics at a time when much of the Arab world was shaking off colonial European rule and embroiled in armed conflict with Israel.

The leftist Nasserist ideology, which centered on what Nasser called “Arab-socialism,” commands little influence in present-day Egyptian politics, but Mr. Heikal remained relevant long after Nasser died, respected for his wide network of international contacts and extraordinary analytical skills.

Mohamed Heikal in 2014 at his office, in Cairo. (Magdy Ebrahim/AP)

Career diplomat Mustafa el-Fiqi described Mr. Heikal as “the nation’s authentic memory.”

Mr. Heikal was born Sept. 23, 1923, to a wheat merchant in the Nile Delta province of Qalyubia.

After attending college in Egypt, he began his journalism career in the early 1940s, working for the English-language Egyptian Gazette. He covered the North African campaign during World War II and later distinguished himself as a correspondent chronicling the civil war in Greece, the U.S. presidential election in 1952, the Korean War, and hostilities between Arabs and Jews.

He met Nasser, a rising officer, on the battlefield during the first Arab-Israeli war, and their relationship deepened over the years. Mr. Heikal’s influence reached its apex as editor in chief of Cairo’s Al-Ahram daily from 1957 to 1974.

In that role, he built a failing publication into a thriving powerhouse. He gingerly straddled support for the regime’s policies with pointed criticism directed at individual governmental organizations.

He added magazine offshoots that appealed to followers of diverse political stripes, including Marxists and avowed capitalists. Edward R.F. Sheehan, a former press officer at the American Embassy in Cairo, once praised Mr. Heikal’s judgment for creating a “safety valve” where “harmless manifestoes” could be printed in an effort to forestall massive anti-government street protests.

Mr. Heikal tampered Egyptians’ distrust of the country’s tightly controlled state media under Nasser with his insider’s take on the country and the region in his eagerly awaited Friday column titled “Frankly.”

The column, closely followed across the Arab world, became known for Mr. Heikal’s “literary journalism,” a writing style emulated to this day by some of his proteges.

Egyptian President Abdel Fatah al-Sissi eulogized Mr. Heikal in a statement, saying the late author “established a distinctive journalistic school that combined political analysis with a magnificent writing style.”

Mr. Heikal’s critics often accused him of being an “apologist” for Nasser’s authoritarian style and restrictions on individual freedoms, as well as for Egypt’s humiliating defeat in the 1967 war with Israel.

Nasser’s successor, Anwar Sadat, sidelined Mr. Heikal shortly after he took office in 1970, removing him from Al-Ahram in 1974, though he offered him the post of presidential adviser, which Mr. Heikal declined.

Of his unwilling departure, Mr. Heikal told Time magazine, “I knew it was inevitable. But I felt that if I didn’t speak out, I would be betraying my profession. Now I have expressed my viewpoint, and I have taken the consequences.”

A decade later, in 1981, Sadat jailed him along with hundreds of government critics just a month before the U.S.-backed president was assassinated by Islamic militants. His successor, Hosni Mubarak, released Mr. Heikal and the others but kept the author at arm’s length throughout his 29 years in office.

Mr. Heikal, who wrote about 40 books, passed a damning judgment on Sadat’s 11 years in power in his 1983 volume “Autumn of Fury, The Assassination of Sadat.” His sharply critical views of Mubarak were evident in “Mubarak and His Age,” his Arabic-language book published in 2012, a year after Mubarak was ousted in a popular uprising.

Despite his poor health, Mr. Heikal was frequently on TV in the past few years, sharing his political views in lengthy interviews, first on Qatar’s Al-Jazeera network and more recently on the privately owned Egyptian network CBC.

Survivors include his wife, Hedayet Olwi, and three sons.