Profile: Hosni Mubarak
Hosni Mubarak ruled Egypt for almost 30 years until he was swept from power in a wave of mass protests in February 2011.
Few expected that the little-known vice-president who was elevated to the presidency in the wake of Anwar Sadat's 1981 assassination would hold on to the country's top job for so long.
Mr Sadat was assassinated by Islamist militants at a military parade in Cairo, and Mr Mubarak was lucky to escape the shots as he sat next to him.
Since then, he has survived at least six assassination attempts - the narrowest escape shortly after his arrival in the Ethiopian capital, Addis Ababa, in 1995 to attend an African summit, when his limousine came under attack.
Besides his knack for dodging bullets, the former air force commander also managed to keep a hold on power by positioning himself as a trusted Western ally and fighting off a powerful opposition movement at home.
But with domestic unrest, his regional clout waning, his health failing, and his succession unclear, many questioned how long Mr Mubarak would be able to carry on.
Then, in a televised address on 1 February 2011, following mass protests in Cairo and other cities, Mr Mubarak announced he had decided not to stand for re-election later that year.
Protests continued and on 10 February he appeared on state television to say he was handing over powers to his vice-president, but would remain as president.
The following day Vice-President Omar Suleiman made a terse announcement saying Mr Mubarak was stepping down and the military's supreme council would run the country.
By 24 May 2011, judicial officials announced that Mr Mubarak, along with his two sons - Alaa and Gamal - would stand trial over the deaths of anti-government protesters.
On 2 June 2012 he was found guilty of complicity in the murder of some of the demonstrators who took part in the wave of protests that began on 25 January 2011. Along with his former Interior Minister, Habib Al-Adly, he was sentenced to life imprisonment for his crimes.
In January 2013, Egypt's Court of Cassation allowed an appeal against Mr Mubarak's and Mr al-Adly's convictions and ordered a retrial. Mr Mubarak and his sons were also due to be retried on corruption charges for which they were originally acquitted.
The new trial over the killings started in May 2013 but was adjourned several times, most recently on 17 August because of the political violence that swept the country following the military's removal of Islamist leader Mohammed Morsi on 3 July.
On 19 August, Mr Mubarak was acquitted of one corruption charge related to embezzlement of public funds, paving the way for a petition filed by his lawyer arguing that there were no legal grounds for his continued detention.
Two days later, a Cairo court ordered his release from prison and Egypt's prime minister said he would be placed under house arrest.
On 22 August, he was flown out of Tora prison in Cairo by helicopter and taken to a military hospital. He had been in custody since April 2011.
He still faces corruption charges and a retrial for alleged complicity in the killing of demonstrators during the protests that brought his rule to an end.
Born in 1928 in a small village at Menofya province near Cairo, Hosni Mubarak insisted on keeping his private life out of the public domain while president.
Married to a half-British graduate of the American University in Cairo, Suzanne Mubarak, he was known to lead a strict life with a fixed daily schedule that began at 0600.
Never a smoker or a drinker, he built himself a reputation as a fit man who led a healthy life.
In his younger days, close associates often complained of the president's schedule, which began with a workout in the gym or a game of squash.
Muhammad Hosni Sayyid Mubarak was sworn in on 14 October 1981, eight days after the Sadat assassination.
Despite having little popular appeal or international profile at the time, the burly military man used his sponsorship of the issue behind Sadat's killing - peace with Israel - to build up his reputation as an international statesman.
In effect, Hosni Mubarak ruled as a quasi-military leader when he took power.
For his entire period in office, he kept the country under emergency law, giving the state sweeping powers of arrest and curbing basic freedoms.
The government argued the draconian regime was necessary to combat Islamist terrorism, which came in waves during the decades of Mr Mubarak's rule - often targeting Egypt's lucrative tourism sector.
He presided over a period of domestic stability and economic development that meant most of his fellow countrymen accepted his monopolisation of power in Egypt.
In recent years, Mr Mubarak felt for the first time the pressure to encourage democracy, both from within Egypt, and from his most powerful ally, the United States.
Many supporters of reform doubted the veteran ruler's sincerity when he said he was all for opening up the political process.
Leading up to his declaration not to stand again for the presidency, the US had heaped pressure on him to stand aside, calling for an "orderly transition" of power to a more democratic system.
Mr Mubarak won three elections unopposed since 1981, but for his fourth contest in 2005 - after a firm push from the US - he changed the system to allow rival candidates.
Critics said the election was heavily weighted in favour of Mr Mubarak and the National Democratic Party (NDP). They accused the Egyptian leader of presiding over a sustained campaign of suppressing opposition groups, most notably the Muslim Brotherhood.
The length of his tenure, along with his age and possible successors, had all been sensitive subjects in Egypt until January and February's mass protests allowed the Egyptian people to find a voice.
People around Mr Mubarak said his health and vigour belied his age - although a couple of recent health scares have been a reminder of his mortality.
Rumours about the president's health gathered pace when he travelled to Germany in March 2010 for gall bladder surgery. They flared every time he missed a key gathering or disappeared from the media spotlight for any conspicuous length of time.
However much Egyptian officials tried to deny them, they kept circulating, with reports in the Israeli and pan-Arab media.
The days of mass protests in Egyptian cities prompted Mr Mubarak to finally name a vice-president. On 29 January, intelligence chief Omar Suleiman was elevated to the role in what was seen as an attempt by Mr Mubarak to bolster his support in the military.
Until then there had been no obvious successor but opposition groups had feared his son, 40-year-old former investment banker Gamal, was being groomed for a kind of dynastic inheritance dressed up as a democratic transition.
Gamal Mubarak insisted he had no ambition to be president, but he had been moving steadily up the ranks of the NDP, becoming a leading advocate of economic and political reform.
Historians point out that every president since the revolution of 1952 has come from the military, and Gamal's civilian credentials may have given him trouble in gaining the support of that important constituency.
In the past, Mr Mubarak had said he would continue to serve Egypt until his last breath. In his speech on 1 February 2011, he said: "This dear nation... is where I lived, I fought for it and defended its soil, sovereignty and interests. On its soil I will die. History will judge me like it did others."