(CNN) Ousted Egyptian strongman Hosni Mubarak , who ruled his country with an iron fist for nearly three decades , has died , his son said on Tuesday. He was 91.

"Indeed, to 'Allah we belong and to Allah we shall return.' My father, Hosni Mubarak, passed away this morning," Alaa Mubarak posted on Twitter , using a common Muslim prayer.

During his 29 years in power, Mubarak survived would-be assassins and ill health, crushed a rising Islamist radical movement and maintained the peace pact with neighboring Israel that got his predecessor killed.

Mubarak was in the intensive care unit at a military hospital in Cairo when he died. He was in surgery on January 23, according to a tweet by his son Alaa Mubarak.

Egypt held a military funeral for Mubarak on Wednesday, with President Abdel Fattah el-Sisi briefly leading the funeral procession.

Sisi was part of the military council that assumed power after Mubarak's removal in 2011. He walked behind the flag-draped coffin along with former Mubarak-era ministers, and Mubarak's sons, Gamal and Alaa.

The heavily guarded funeral was held in Al-Mosheer Tantawy Mosque, named after Mubarak's former defense minister Mohamed Hussein Tantawy, who led the military council after Mubarak's ouster in 2011.

The Soviet-trained bomber pilot became one of the leading US allies in the Middle East, receiving tens of billions of dollars in American military aid, and his government's continued observance of the Camp David accords with Israel was the cornerstone of the so-called "cold peace" between the formerly warring neighbors.

But following a January 2011 revolt in Tunisia that launched the Arab Spring uprisings, demonstrators on the streets of Cairo stood up to riot police, and the army refused to intercede on his behalf. Mubarak handed over power to a military council in February and went into seclusion in the resort town of Sharm el-Sheikh

President Abdel Fattah al-Sisi, center, former interim president Adly Mansur, second left, and Mubarak's sons Alaa and Gamal attend the funeral.

After his resignation, Mubarak spent several months on trial, accused of crimes including corruption, abuse of power, and conspiring to kill the protesters who rose up against him. Denying all charges, he showed no remorse, and uttered no words of regret for those who were killed or injured.

A frail Mubarak attended much of his trial on a gurney, suffering, his attorneys disclosed, from a variety of circulatory ailments and stomach cancer. When the trial concluded the following year, the former president declined his opportunity to speak.

Though prosecutors had requested that Mubarak be hanged if found guilty, he was instead sentenced to life in prison. It was a punishment decried as too lenient by many Egyptians, who demanded the ultimate retribution for what they viewed as years of humiliation at the hands of the authoritarian leader.

Egyptian honor guards escort the coffin during Mubarak's funeral.

One-time national hero

It was a hard fall from grace for the man who had begun his political career as a national hero. Born in 1928 in the Nile Delta town of Kafr-el Meselha , Mubarak had graduated from Egypt's national military academy at 21 and gone on to join the country's air force. By 1966, he was the director of the air academy, and the early success of Egyptian pilots against Israel in the 1973 Yom Kippur War won him acclaim.

Then-President Anwar Sadat made him vice president in 1975. In that post, Mubarak led the day-to-day operations of the government, freeing Sadat to focus on international affairs -- particularly his 1977 peace overture to Israel, which led to the 1978 Camp David Accords and a Nobel Peace Prize.

But in 1981, Sadat died in a hail of gunfire at a military parade, killed by Islamist militants from within the military's own ranks, angered by the Egypt-Israel pact.

Mubarak, right, was sworn in as Anwar Sadat's successor on October 14, 1981, becoming Egypt's fourth president.

Upon assuming office, one of Mubarak's first acts was to reaffirm Egypt's adherence to the accords. He then declared a state of emergency that barred unauthorized assembly, restricted freedom of speech and allowed police to jail people indefinitely -- and he made extensive use of those powers in the decades that followed. Throughout his rule, he was accused of grave human rights violations by international monitors.

In 1986, the Egyptian army waged a bloody crackdown on mutinying paramilitary conscripts, and an estimated 30,000 people were thrown in jail when jihadists carried out a string of attacks on tourists in the 1990s. Mubarak escaped multiple assassination attempts, including a particularly close call in 1995 when Islamist militants opened fire on his motorcade at a pan-African conference in Ethiopia.

Iron grip on population

During that time, however, Egypt remained a key Western ally , receiving more than $1 billion a year in US military assistance and contributing troops to the American-led coalition that drove Iraq out of Kuwait in 1991.

Mubarak and US President Bill Clinton hold a joint press conference in 1995. At the time, he was a key ally of the West.

But Mubarak opposed the US invasion of Iraq in 2003 and eventually grew frustrated with the foundering Israeli-Palestinian peace talks, in which he was a major player. And Washington became increasingly critical of the iron grip he kept on his population, particularly after elections in 2005 and 2010 that were widely criticized by outside observers.

While economic development picked up in the last decade of his rule, in rural areas up to 40% of Egyptians remained mired in poverty, and the official unemployment rate was nearly 10%. Those conditions helped fuel the protests that toppled him, as they had in the Tunisian revolt that launched the Arab Spring.

Until the very last days of his rule, Mubarak resisted naming a vice president, calling the succession of Egypt's leadership into question. Younger son Gamal had been seen as his likely heir in later years, but that arrangement was never formally cemented. As the uprising intensified, Mubarak turned to his longtime spy chief, Omar Suleiman -- a figure trusted in Western circles for his assistance in battling the al Qaeda terrorist movement, but widely feared at home.

Mubarak named Suleiman vice president on January 29, 2011. On February 10, with the protests growing by the day, he announced that he was delegating much of his authority to his deputy but vowed to remain in power

The arrangement lasted barely a day. On February 11, Suleiman announced Mubarak's resignation in a one-minute televised address and turned over power to the armed forces

Acquitted over killings

During his subsequent detention and trial, the health problems that had long been the subject of speculation were finally revealed. A 2010 operation in Germany, ostensibly to have his gall bladder removed, had in fact been for stomach cancer, his lawyers said. The surgery had been extensive, with part of Mubarak's pancreas and a growth on his small intestine removed as well; still, the cancer was growing.

Mubarak seen inside a cage in a Cairo courtroom during his trial in 2012.

Days after the 2012 verdict, officials said Mubarak's health was deteriorating in prison . Heart problems forced doctors to use a defibrillator to revive him. He was placed on a ventilator several times and slipped into a coma.

In March 2017, more than six years after the protests that toppled him, Mubarak was freed from prison at the age of 88.

In Mubarak's final years, his assets were unfrozen by a Swiss court and his family reunited.