Egypt's former president Hosni Mubarak, who ruled for three decades before he was ousted amid the Arab Spring protests in 2011, died Tuesday at age 91.
The once burly autocrat with the trademark sunglasses, who became witheringly frail after multiple surgeries towards the end of his life, spent years in custody for his role in the deaths of protesters but was freed in 2017 after the convictions were overturned.
His son Alaa Mubarak wrote on Twitter: "This morning my father, president Mubarak, passed away".
His death was confirmed by the presidency and on state television.
Mubarak's brother-in-law, General Mounir Thabet, told AFP that the family was by Mubarak's side at the hospital.
A military funeral was planned for Wednesday, to be followed by three days of mourning, said the office of President Abdel-Fattah al-Sisi.
Mubarak had long battled illness and was recently admitted to a Cairo military hospital's intensive care unit, as media speculated on whether he suffered cancer, heart troubles or respiratory ailments.
Tributes poured in from leaders in the Middle East, where Mubarak's Egypt, a key ally of the United States, had at times served as a mediator, especially in the Israeli-Palestinian conflict.
Israel's Prime Minister Benjamin Netanyahu praised Mubarak's commitment to "peace and security" when he ruled Egypt, the first Arab state to make peace with Israel and establish full diplomatic relations.
And Palestinian president Mahmud Abbas said he mourned the death "with great sorrow" and hailed Mubarak's support of the Palestinian cause.
The long-time president started off as a military pilot and was commander of the air force in the 1973 war with Israel.
President Sisi's office offered condolences and hailed Mubarak as one of the "heroes of the October 1973 war against Israel".
Mubarak became vice president in 1975 before taking power in 1981, following the assassination of former president Anwar al-Sadat by Islamist militants.
Mubarak was sitting near Sadat but survived, going on to dodge bullets during several more attempts on his life, including one by Islamist militants in 1995 in the Ethiopian capital Addis Ababa.
He remained head of state for three decades but was overthrown in 2011 after three weeks of mass protests that started on January 25.
His ouster came amid mounting popular anger triggered partly by rampant police brutality and by 2010 parliamentary elections which were widely slammed as rigged.
Mubarak faced multiple charges after his overthrow, including over the deaths of protesters in 2011 and for corruption.
While Mubarak was locked away or in the dock, he was succeeded in 2012 by the Muslim Brotherhood's president Mohamed Morsi.
Morsi was ousted in 2013 by then general Sisi, who took power the following year, reimposing strict police powers. Morsi died last year but with no public fanfare and a derision of his short reign across Egyptian media.
In the years since, many Egyptians' aversion to Mubarak has gradually given way to indifference mixed with nostalgia, and many now remember his rule as a bygone period of stability.
Mubarak, a determined foe of Islamist radicalism, maintained a state of emergency for the entirety of his rule that gave sweeping powers to the country's feared security services.
Internationally, Mubarak garnered respect as a regional power broker, including in the Israeli-Palestinian conflict.
As a staunch US ally, Egypt took billions in military aid and agreed to liberalise its economy, especially in the crucial tourism sector.
Anwar Gargash, the United Arab Emirates' minister of state for foreign affairs, hailed him as "a statesman ... who espoused nationalistic and historical positions".
Abu Dhabi Crown Prince Mohammed bin Zayed Al-Nahyan described Mubarak as "an Arab leader who worked loyally for Arab unity and stability and stood firmly against extremism and terrorism".
The former head of the International Atomic Energy Agency, Mohamed El-Baradei, who was a key opposition figure in the waning years of Mubarak, paid his respects.
"May God have mercy on the former president ... and grant his family patience and comfort," he said on Twitter.
Other opposition activists who were prominent in the revolution that unseated Mubarak, such as Wael Ghoneim, were also forgiving in their words on social media.
"He was loyal and loving of Egypt ... He took on a great responsibility towards the Egyptian people," wrote Ghoneim on Twitter.
"He was right a lot of the time and also wrong a lot of the time ... history will decide."
Former presidential candidate Ayman Nour -- who ran against Mubarak in multi-candidate elections widely seen as fraudulent in 2005, lost and was subsequently jailed -- was also conciliatory in his tone.
"I promise to God I personally forgive him," he said.