Hosni Mubarak, the former Egyptian leader who ruled for nearly 30 years before he was forced out by a 2011 popular uprising, died in hospital on Tuesday, according to the country’s state media. He was 91.

Mubarak, a former air force commander and war hero, will be given a military funeral on Wednesday, according to officials, in a nod by the powerful military to one of its own.

The office of President Abdel Fattah El Sisi, himself a career army officer before taking over the land’s highest office in 2014, mourned Mubarak’s death in a statement, hailing him as a war hero and offering condolences to his family. The presidency announced three days of official mourning over Mubarak’s death, beginning on Wednesday.

Separately, the country’s powerful military also mourned Mubarak, who is survived by his wife, Suzanne, his two sons Alaa and Gamal and four grandchildren.

The former president was transferred to intensive care at a Nile-side military hospital in Cairo’s suburb of Maadi earlier this month, according to his son Alaa, who gave no details on his father’s ailment. In a series of tweets last weekend, he asked his father’s supporters to pray for his recovery.

إنا لله و إنا اليه راجعون ، انتقل الي رحمه الله صباح اليوم والدي الرئيس مبارك . اللهم أعفو عنه و اغفر له و ارحمه . pic.twitter.com/xOFgjZ7phr — Alaa Mubarak (@AlaaMubarak_) February 25, 2020

State television said Mubarak had recently undergone an unspecified surgery at a Cairo hospital. The operation was followed by complications which, again, the television did not specify.

Mubarak leaves behind a mixed legacy, partially because of the relatively long time he had spent at the helm of the most populous Arab nation and partially because of the momentous events that gripped the region while he was in power.

A staunch ally of the United States for most of his 29 years in power, Mubarak made himself a name as a regional icon of stability and a sworn enemy of Islamist militants. He has also been something of a zealous guardian of the peace treaty signed with Israel in 1979 by his predecessor Anwar Sadat, who was assassinated by extremists during a military parade nearly 40 years ago. Mubarak, then a vice president with a reputation for diligence, was by Sadat’s side when he was gunned down but only suffered a superficial hand wound.

Israeli Prime Minister Benjamin Netanyahu praised Mubarak for achieving "peace with Israel". Palestinian President Mahmoud Abbas hailed his support for the Palestinian cause.

Mubarak forged close ties with Gulf Arab nations, particularly the UAE and its Founding Father, Sheikh Zayed.

President Sheikh Khalifa expressed his heartfelt condolences and offered solace to Mr El Sisi after Mubarak’s death.

Sheikh Khalifa ordered the UAE flag to be flown at half-staff outside government offices and diplomatic missions abroad for one day.

Sheikh Mohammed bin Rashid, Vice President and Ruler of Dubai, also sent a message of condolence to the Egyptian president.

Sheikh Mohamed bin Zayed, Crown Prince of Abu Dhabi and Deputy Supreme Commander of the Armed Forces, sent his condolences and tweeted that Mubarak worked “for unity and stability” and stood “strongly against extremism and terrorism”.

Dr Anwar Gargash, Minister of State for Foreign Affairs said: “The Arab world today lost a statesman who had taken key patriotic and historic stands.”

Mubarak, he tweeted, “was distinguished by wisdom and bravery”.

فقد العالم العربي اليوم رجل دولة، صاحب مواقف وطنية وتاريخية كبيرة. الرئيس حسني مبارك رحمه الله تميز بالحكمة والشجاعة. ودوره في معركة تحرير دولة الكويت وأزمات عديدة طالت الوطن العربي، يحفظه التاريخ. عزاؤنا لأسرة الرئيس الراحل وللشعب المصري الشقيق. — د. أنور قرقاش (@AnwarGargash) February 25, 2020

Mubarak will be remembered for the high GDP growth in Egypt during his years in office, the record number of foreign tourists and the modernisation of many aspects of life in the country.

But he was also often faulted at home for allowing his security forces to use intimidation against his people. He demanded the unflinching loyalty of those who sought senior positions in the public sector, government ministries, academia and the diplomatic service.

On his watch, the now-banned Muslim Brotherhood group also developed a far-reaching network of social, medical and educational services on which millions of people relied where government services were inadequate or non-existent.

The group swept presidential elections in 2011 and 2012.

The turmoil in which Egypt became mired in the period immediately after he was removed was deepened by his and his family’s predicament.

Mubarak faced six years of legal proceedings after his detention in April 2011.

These included a trial on charges that he was responsible for the deaths of about 800 protesters during the 18-day uprising against his rule.

His conviction and life sentence were overturned on appeal in 2014, but he, along with his two sons – wealthy businessman Alaa and one-time heir apparent Gamal – was convicted of embezzlement and sentenced to three years in prison.

The two sons were released in 2015 for time served and Mubarak walked free in 2017.