CAIRO — Former President Hosni Mubarak’s health has deteriorated so sharply since he was first taken to prison five days ago that the authorities are close to a decision to return him to a hospital outside the penal system, security officials and the state news agency said on Wednesday.

Mr. Mubarak, 84, has suffered heart attacks, high blood pressure, a nervous breakdown and severe depression, a state news agency reported. He was placed on a respirator at least five times in the prison’s intensive care unit, state news reports said, adding that on Monday the former president, who was once a fighter pilot, cried after a visit from his wife.

Any decision to move Mr. Mubarak out of prison would further inflame public opinion, with less than two weeks to go before the runoff in the country’s first competitive presidential election. The contest pits Mr. Mubarak’s last prime minister, Ahmed Shafik, against Mohamed Morsi of the Muslim Brotherhood, Egypt’s largest Islamist group.

Before the reports circulated that Mr. Mubarak might be moved, thousands of people were already in the streets of Cairo, Alexandria and other cities for a fifth night of protests at the weak verdict handed down against him, which appeared likely to collapse on appeal.