He declared an emergency law - in place throughout his entire presidency - that allowed him to keep political opponents in prison without being charged or going to trial. Many of his prisoners were tortured and executed. Mubarak's aura of invulnerability quickly evaporated in 2011. Violent clashes between security forces and protesters left hundreds dead. Yet the protests persisted - for 18 days in all - inspired by a rebellion that began in Tunisia and came to be known as the Arab Spring. Egyptian President Hosni Mubarak with world leaders including US President Bill Clinton at the March 13, 1996, Summit for Peacemakers in Egypt. Credit:AP Under mounting pressure, Mubarak agreed on February 11, 2011, to cede his powers to a military council leadership. Egyptians rejoiced wildly at the announcement, the first sign that an Arab leader would be held to account for widespread corruption and repression. He was ordered to stand trial on charges including involvement in the killing of protesters in Cairo's Tahrir Square and the embezzlement of tens of millions of dollars from state coffers; his two sons, accused of vast corruption, also went on trial.

Anti-Mubarak Egyptians cheered the sight of the deposed strongman scowling from behind a metal cage in the courtroom. "I never did anything wrong," Mubarak declared at one of his trials. He presented himself as an ailing man, donning sunglasses and entering the courtroom on a stretcher after flying via helicopter from his comfortable room at a military hospital. With Mubarak out of power, the country descended into chaos. Mohamed Morsi, a leader of the long-banned Muslim Brotherhood, was elected president in 2012. Morsi barely lasted a year. He never gained the confidence of the state security apparatus, and his incompetence as a politician lost him support among workaday Egyptians fed up with the rapidly sinking economy and fears that he was pushing for an Islamist-backed constitution. Hosni Mubarak waves to his supporters from behind bars as he attends a hearing in his retrial on appeal in Cairo on April 13, 2013. Credit:AP Another mass gathering in the streets led to a military junta seizing control in 2013, under General Abdel Fatah el-Sisi. Determined to crush dissent, the new government massacred hundreds of supporters of the ousted Morsi that summer. Mubarak's fortunes seemed to reverse with Sisi in charge. At his first trial, in 2012, Mubarak was given a life sentence for the deaths of protesters. Thousands took to the streets in fury that he had not been sentenced to hang. An appeals court overturned the verdict, and he was exonerated at retrial.

However, he and his sons Alaa and Gamal were found guilty of siphoning state money for personal use, sentenced to three years each in prison and ordered to pay $20 million in reimbursement. It was widely perceived as a token amount, given that the Mubarak family reportedly had $433 million stashed in Swiss bank accounts, according to a Swiss government official. The rulings paved the way for Mubarak's eventual release. In March 2017, at the age of 88, he walked out of detention a free man. He was whisked off to a mansion in the Cairo suburbs. The activists who had packed Tahrir Square in the pan-Arab uprising that forced him from power greeted his release in sullen silence, the promise of their revolution long since lost. Ordinary Egyptians, beset by economic ills and terrorist threats, and witnessing Sisi's brutal treatment of dissenters, responded with weary indifference. Hosni Mubarak was an air force commander in October 6, 1974. Credit:AP As president, Mubarak never wavered in his commitment to the course that Sadat had charted with Israel. He was by no means a friend of the Israelis, who often expressed annoyance with him, but he maintained a "cold peace" with his eastern neighbours and kept Egypt mostly out of war.

He largely cooperated with Israel on its blockade of the Gaza Strip, even while members of his intelligence service worked closely with Hamas, the Palestinian militant organisation that controls the strip and that the United States and other Western countries consider a terrorist group. Despite the blockade, which began in 2007, Palestinian militants in the Gaza Strip were plentifully supplied with weapons smuggled through tunnels that connected the territory to Egypt. By the mid-1980s, Mubarak had re-established ties with his Arab neighbours. As the leader of the most populous country in the Arab world, he wielded considerable diplomatic sway in the region. He was a frequent - but mostly ineffective - intermediary between Israel, Washington and the Palestinians. August, 18, 2009: President Barack Obama meets with Hosni Mubarak in Washington. Credit:AP During the 1991 Persian Gulf War, Mubarak considered Saddam Hussein's invasion of Kuwait to be an act of reprehensible aggression. He sent 45,000 Egyptian troops to war against Iraq with the US-led forces. Mubarak won $10 billion in debt forgiveness as a reward. Under Mubarak, Egypt achieved greater prosperity than it had ever known. After the September 11, 2001, attacks, he became a close ally of the United States in combating terrorism and cast his regime as a shield against Islamist extremism. (He was rewarded handsomely for his long-term cooperation with the United States. During his last year in office, total US assistance to Egypt amounted to about $1.5 billion, most of it for the military.)

In the 2000s, Mubarak's attitude toward the United States began to change. At first, he collaborated with the George W. Bush administration in the campaign against international terrorism. During Bush's second term, relations turned icy over Mr Mubarak's reported abuses against prisoners and political dissidents. The Bush administration began a vigorous campaign to push Mubarak to accept democratic reforms as part of its "freedom agenda." Pressured by Washington, Mubarak acceded to demands in 2005 to have multi-party elections for the first time since he became president. February, 3, 1982: British Prime Minister Margaret Thatcher with Hosni Mubarak outside her home at Chequers, England. Credit:Getty Images In what was not considered an open election, Mubarak handily won his fifth consecutive term in office that same year. Invigorated by his victory, he acted defiantly toward the United States and denounced Bush administration policies involving democratic initiatives. A stark discontent lurked beneath the seemingly staid surface. Moving away from state ownership of enterprises, Mubarak instituted a system of sanctioned monopolies rather than endorse a free market.

The big monopolies, as well as the police, the military and the intelligence services, all reported separately to the top - to Mubarak. It was a stovepipe system that gave him authority over a broad swath of Egyptian life, and it made him very rich. Corruption mushroomed and became a weight on the whole society, suppressing growth and, over time, exasperating and finally infuriating ordinary Egyptians. February, 12, 2011: A protester holds up a sign that reads 'Finally he steps down' in Tahrir Square, Cairo. Credit:AP The popular revolt that led to Mubarak's ouster was organised by youth groups fed up with the lack of political liberty. Using social media platforms such as Facebook, younger, generally urban Egyptians created a vast network of like-minded rebels and rallied together to foster change. In the end, the Egyptian people didn't trust Mubarak to make any significant reforms after decades of stagnancy. In writing their own drama, they spelled the end of Mubarak's reign.

Mubarak married Suzanne Sabet in 1959. Besides his wife, survivors include their two sons. During his last decade in office, Mubarak began to groom his son Gamal to succeed him as president. He eventually installed Gamal as secretary general of the ruling National Democratic Party. Although father-son succession is a typical practice within autocratic states, the possibility of the arrangement fuelled discontent among the Egyptian people. Mubarak believed that only an Egypt under the control of a man of his strength and will could hold back the forces of extremism in the Arab world. The Middle East, he told CNN in 2002, "will be the biggest source of terrorism, more and more. It will generate a new generation of terror ... We will have to be very careful. If you don't believe it, sometime you'll believe what I'm saying." The Washington Post