Mubarak, 84, was slipping in and out of consciousness, was suffering from high blood pressure and breathing difficulties, and was in a deep depression, according to security officials at Torah prison where he is serving a life sentence. Doctors there could not find a pulse twice, and used the defibrillator, they said.
The deposed leader, who was being given liquids intravenously, also lost consciousness several times Sunday.
His health crisis came at time of political anxiety in Egypt, with a former prime minister from the Mubarak regime facing an Islamist in a showdown at the ballot box on June 16-17.
"He is causing everyone a headache," said Ahmed Badawi, a liberal activist who participated in last year's Arab Spring uprising that ousted Mubarak. "There are daily rumors that he died and where he is held is also a thorny issue. He is definitely feeding the nervousness we are all living in these days."
Egypt is in the home stretch of a 16-month transitional period overseen by the military council that succeeded him—a time that has seen the rising power of the Islamists, deadly street protests and gross human rights abuses blamed on the generals, including the torture of detainees and trials for civilians in front of military tribunals.
The generals have promised to hand over power to a civilian administration by July 1, about 10 days after the winner of the runoff is announced. The election pits Ahmed Shafiq, Mubarak's last prime minister, against Mohammed Morsi of the Muslim Brotherhood.
But that all could be thrown into chaos Thursday if Egypt's highest court—the Supreme Constitutional Court—rules that legislation banning Mubarak regime figures from running for office is constitutional. Shafiq would be booted out of the race, the runoff would be canceled and the first round of voting would be repeated.
The court could also uphold a lower court ruling that the law governing parliamentary elections held over three months starting in November was unconstitutional. That decision could lead to the dissolution of the Islamist-dominated parliament or a partial repeat of the election.
Shafiq, like Mubarak a former air force officer, is widely viewed as the quintessential "feloul," or remnant of the old regime. His law and order platform has resonated among many Egyptians frustrated by persistently tenuous security, a faltering economy and a seemingly endless wave of protests, sit-ins and strikes.
While a Shafiq win will most likely lead to an eruption of protests, a Morsi presidency is widely feared to serve as a vehicle for more religion in government and restrictions on freedoms, a prospect that liberals, leftists, women and minority Christians find to be alarming.
Should Mubarak die in the coming days, it could also have an impact on the result of the runoff.
"We are a very emotional people. So, if Mubarak dies before the election, there will be an outpouring of sympathy for the regime, and Shafiq can certainly benefit from that," said Mahmoud Zaki, a political activist and a Brotherhood member. "When Mubarak's grandson died several years ago, we all forgot what he did for us and we mourned with him the loss of the young boy."
Morsi, on the other hand, has vowed to retry Mubarak if he wins the presidency, but many believe that his pledge was pandering to the youth, pro-democracy groups that engineered last year's anti-regime uprising.
Mubarak has been held in the intensive care ward of the prison hospital south of Cairo since June 2, when he was convicted of failing to prevent the killing of protesters in the February 2011 uprising. He was sentenced to life in prison.
His two sons, onetime heir apparent Gamal and wealthy businessman Alaa, were at his bedside, the security officials said on condition of anonymity because they were not authorized to speak to the media. The sons also are being held at the prison, awaiting trial on insider trading charges after they and their father were acquitted June 2 of corruption charges.
Mubarak's wife, Suzanne, visited him Sunday and, according to the officials, demanded that he be transferred to a better-equipped hospital outside the penal system. The officials said such a transfer was likely unless Mubarak's health improves.
Mubarak's death would bring down the curtain on a chapter of Egypt's modern history that has divided this mainly Muslim nation of 85 million people. That legacy is alive today through the Shafiq-Morsi rivalry: Shafiq, a self-confessed admirer of Mubarak, is pitted against Morsi, a U.S.-trained engineer who belongs to a group that the ousted leader spent most of his time in office cracking down on it.
Mubarak's 29 years in power are the second longest by any ruler of Egypt since the 19th century, when the Ottoman general Mohammed Ali ruled the country for about 44 years ending with his death in 1849. While Mohammed Ali went down in history as the founder of modern Egypt, Mubarak's rule has been defined by corruption, police brutality and the behind-the-scenes rise to power by a coterie of regime-backed businessmen.
But Mubarak's demise could be a gift to the next president as well as the generals.
For example, where Mubarak is held—he was detained in hospital suites from the time of his arrest in April 2011—has been and is likely to continue to be a divisive issue, with many Egyptians accusing authorities of showing him too much reverence. Others continue to see him as a decorated war hero whose old age and service to Egypt are grounds for leniency.
The issue is even more sensitive to the generals, who are led by Mubarak's defense minister of 20 years and who owe their ascent to his patronage. A pardon for Mubarak or a transfer back to a military hospital—a luxury when compared to his prison hospital—would confirm long held suspicions by revolutionaries that the generals have only grudgingly ordered his arrest and that they remain loyal to him.
Mubarak would not get a military or a state funeral if he dies now, since his conviction meant that he is stripped of military rank and any claim to special treatment as a former president.
"The generals will breathe easier if he is gone," said Michael W. Hanna, an Egypt expert from New York's Century Foundation. "The ongoing saga about his health, the prospect of him getting an acquittal on appeal, that is all very destabilizing and they have to deal with it."
In his last public appearance at his June 2 sentencing, the bedridden Mubarak sat stone-faced in the defendants' cage in the courtroom, his eyes hidden behind dark glasses. Officials said he broke into tears when he learned he was being transferred to a prison. It took officials hours to convince him to leave the helicopter that ferried him from the courthouse to the prison.
Media reports quoted Mubarak at the time as saying the military council who took over after his ouster had deceived him. "Egypt has sold me out. They want me to die here," he reportedly said.