FROM START to finish, the prosecution of former Egyptian president Hosni Mubarak offered a textbook example of how not to handle a deposed dictator. Mr. Mubarak is likely culpable for crimes of corruption and of human rights. But the charges brought against him were vague and poorly substantiated, and the trial itself was chaotic and preemptory. The verdict, delivered Sunday, was a final travesty that has served only to further polarize Egypt.

Mr. Mubarak and his former interior minister were found guilty of failing to prevent the killing of protesters; they were sentenced to life imprisonment. But six police officials more directly responsible for the deaths were acquitted, and Egyptian legal experts predicted that Mr. Mubarak’s sentence would be reversed on appeal. Confined to a military hospital for most of the past 16 months, the 84-year-old former president was forced to move into a less comfortable prison clinic, but he may not be there for long.

His trial was less a serious judicial exercise than a smokescreen thrown up by the military council that removed him from office. The generals who once reported to Mr. Mubarak now desperately seek to preserve their power, despite a promised transition to democracy, and to avoid being held accountable for their own crimes. Mr. Mubarak’s prosecution was meant to defuse the popular demand that the old regime be held accountable while obstructing it in every meaningful sense. An equally farcical trial of U.S.-backed pro-democracy activists is the other side of this strategy; it is due to resume in Cairo on Tuesday.

Egyptians who demanded Mr. Mubarak’s trial in demonstrations last year played into the regime’s hands. They would have done better to recognize that only a democratic government and a purged and reformed judiciary would have the legitimacy and the will to conduct a thorough and fair proceeding. Even then, prosecution of the aged former leader should have been balanced against the need for political reconciliation. As it is, the backlash against the revolutionaries is boosting the reactionary presidential campaign of Mr. Mubarak’s former prime minister, while other entrenched Arab governments are brandishing photos of the former Egyptian ruler in a courtroom cage as they refuse to compromise with opponents.

Mr. Mubarak at least avoided the fate of Saddam Hussein, whose squalid execution followed an equally rushed and unsatisfactory trial. But his legal ordeal may not be over. The presidential candidate of the Muslim Brotherhood has promised to retry him if elected, and to keep him in jail “forever.” Arguably the author of decades of political repression deserves little better; but such political prosecutions only weaken the cause of a democratic rule of law in Egypt.