CAIRO — As alibis go, this one would seem to be airtight: Your honor, my client was only a year old at the time of the crime.

But it did not stop an Egyptian military court from convicting the accused, a boy now 3 ½, of killing three people, carrying guns and firebombs, blocking a road with burning tires, and trying to damage government buildings — and sentencing him to life in prison.

The verdict came last week in a mass trial of 107 people suspected of being members of the outlawed Muslim Brotherhood, and the charges stemmed from the protests, street clashes and police crackdowns in Egypt after the military overthrow of the elected Islamist president, Mohamed Morsi, in 2013. Hundreds of people were killed and thousands were jailed.

After an uproar over the conviction of the boy — Ahmed Mansour Qorani Sharara, who was never arrested — the military said that it was a case of mistaken identity, and that the authorities had actually meant to try a 16-year-old student with the same name. The teenager is on the run, the military added in a post on its official Facebook page.