CAIRO — It took one session on Jan. 10 for a court in the Nile Delta province of Beheira to sentence Karim al-Banna, a 21-year-old student, to three years in prison for saying on Facebook that he was an atheist. The student’s lawyer complained that he was denied the right even to present a defense, but an equally chilling aspect of Mr. Banna’s case is that his father testified against him.

Also telling is that Mr. Banna was originally arrested, in November, when he went to the police to complain that his neighbors were harassing him. This was after his name had appeared in a local newspaper on a list of known atheists. Instead of protecting him, the police accused him of insulting Islam.

Such tag teams of family, media and state are not uncommon in cases against atheists. Because atheism itself is not illegal in Egypt, charges are laid under laws against blasphemy or contempt for religion. In 2012, a 27-year-old blogger, Alber Saber, received a three-year sentence on charges of blasphemy for creating a web page called “Egyptian Atheists.” In 2013, the writer and human rights activist Karam Saber (no relation) was convicted of defaming religion in his short story collection “Where Is God?”

Similar charges have been used for political purposes against Egypt’s Christian minority. In 2013, a Coptic Christian lawyer, Roman Murad Saad, was sentenced in absentia for “ridiculing” the Quran. From 2011 to 2013, Egyptian courts convicted 27 of 42 defendants on charges of contempt for religion.