CAIRO — Deposed Egyptian President Hosni Mubarak, addressing a Cairo court at length for the first time since being driven from office in a popular uprising 3 1/2 years ago, on Wednesday offered up a forceful defense of his nearly three-decade rule and denied he had ordered the killing of more than 800 protesters.

Speaking from a gurney inside the defendants’ caged dock, the 86-year-old former leader appeared far more vigorous and healthy than in previous court appearances, during which he had sometimes seemed barely able to rouse himself to speak. Authorities have cited health problems as the reason for keeping him confined in a military hospital rather than prison as he serves a three-year term in a separate corruption case.

Clad in a dark blue jacket, wearing glasses and sitting upright, the ex-president told the court he would never countenance the killing of compatriots. He also said he voluntarily relinquished power in order to prevent the country from sliding into chaos and violence.

“I would never hand down orders for the killing of a single Egyptian citizen, under any circumstances,” he said. “I would never hand down orders to cause anarchy or a political vacuum.”

Together with his two sons and seven former senior aides, Mubarak is accused of ordering the killing of demonstrators in the 2011 uprising against him, as revolts against authoritarian rule swept the region.

Mubarak told the court that the uprising had been “infiltrated” by Islamists, and blamed them and their “local and foreign supporters” for causing the outbreak of violence – part of a pattern of statements by him and former top officials to reshape the narrative of the uprising. Earlier this week, his former interior minister, Habib Adli, said the 2011 revolution grew out of a “conspiracy” in which the United States took part.

The ex-president was previously convicted and sentenced to life in prison in connection with demonstrators’ deaths, but then won a retrial. A verdict is expected at the end of next month.