Hosni Mubarak’s long life encompassed the history of both modern Egypt and modern Israel.
A young pilot serving in King Farouk’s forces, he embraced the revolution of 1952 which ousted the monarchy and brought the Free Officers Movement to power.
The dominance of the military through its leaders — Mohamed Neguib, Gamal Abdul Nasser and Anwar Sadat — provided him with the ladder to the presidency, ruling Egypt for three decades and presiding over a cold peace with Israel.
Following Israel’s decimation of the Egyptian air force during the Six Day War, Mubarak rebuilt it and was credited with ensuring that the initial phase of the Yom Kippur war was a close-run thing for Israel.
Two years later Sadat appointed him vice-president, a seemingly unthreatening and compliant number two.
This all changed in 1981 when Khaild Islambuli assassinated Sadat and ten other dignitaries at a parade to commemorate the crossing of the Suez Canal during the Yom Kippur war.
Mubarak was only lightly wounded in the attempt by Islamic Jihad to eliminate the entire leadership in one fell swoop.
The Islamists carried out these killings to protest the Camp David agreement, signed by Sadat and Menahem Begin in 1979, which brought an end to the 30-year war between the two countries.
Mubarak heavily expanded the intelligence and security services — and there were at least six attempts to kill him during his time in office.
His rule was marked by a vehement opposition to Islamism and in particular to the Muslim Brotherhood, who responded to his crackdown by reprisal attacks on Coptic churches and foreign tourists.
He was hostile to Hamas and its takeover of Gaza in 2007 — and implicitly supported the Israeli siege of the area.
Mubarak continued the policies of Sadat towards Israel and, in return, recieved the economic support of the United States.
He argued privately for a Palestinian state on the West Bank as a component of a confederation with Jordan.
He also prolonged the emergency laws enacted after Sadat’s killing such that his regime became a byword for authoritarianism as well as corruption and cronyism — he was said to be personally worth tens of billions of dollars.
Even the Bush administration was critical: the US secretary of state, Condoleeza Rice, attacked the Mubarak regime at Cairo University in June 2005 for its human rights abuses and demanded free elections.
But Egypt was too important a strategic player in the Middle East and such verbal indignation remained mere rhetoric.
When the Arab Spring broke out in Cairo’s Tahrir Square at the beginning of 2011, Barack Obama privately urged Mubarak to implement reforms.
Instead he toughened his stand, killing hundreds of protesters. Three weeks later, he was forced to resign.
Although Mr Obama came late in the day in supporting calls for democracy in Egypt, both Saudi Arabia and Israel considered that a trusted ally of the United States had been betrayed by the White House — and wondered if it would be their turn next.
Mubarak refused to go into exile — he was offered a sojourn in Eilat — and in 2012 was sentenced to life imprisonment.
The subsequent election however did not bring to power the representatives of the enlightened liberal elite that had brought down Mubarak; instead, the impoverished masses elected the Muslim Brotherhood under Mohammed Morsi.
This was all too much for the military which rapidly overthrew Morsi and ordered a retrial for Mubarak, who was finally acquitted in 2017.
Mubarak exacted his revenge a year ago when he testified at Morsi’s own trial.
A cold peace with Israel, perhaps — Mubarak only visited for Yitzhak Rabin’s funeral — but he undoubtedly promoted the absence of conflict between Egypt and Israel to the benefit of all.