CAIRO: An Egyptian court convicted four Coptic Christian teenagers for contempt of Islam on Thursday, after they appeared in a video mocking Muslim prayers, sentencing three to five years in prison and referring a fourth, who is under 18, to a juvenile detention facility.

The harsh ruling — which has followed a surge of blasphemy cases in Egyptian courts — underscores a culture of intolerance within the country's judicial system at a time when the Egyptian President Abdel-Fattah el-Sissi is seeking to position himself as an advocate for religious reform.

The 30-second video showed the students pretending to pray, with one kneeling on the floor while reciting Qur'anic verses and two others standing behind him and laughing. One waved his hand under a second's neck in a sign of beheading. The video was filmed by the students' teacher, who is also a Christian, and who was sentenced to three years in prison for insulting Islam in a separate trial.

Their teenagers' lawyer, Maher Naguib, said his clients, who are high school students in the southern province of Minya, haven't been detained and didn't appear in court for the trial.

Some ten security trucks surrounded the court building in the southern city of Bani Mazar. The families of the students cried, and some women wailed in disbelief and collapsed on hearing the verdict.

Naguib described the ruling as "unbelievable" and said the judge should have just punished the teenagers with a fine.

Iman Girgis, a mother of one of the convicted students, Moller Atef, told The Associated Press, "my son was sentenced to five years for laughing. Is that possible?"

"What kind of justice is this?" she added.

Naguib said the video came to light in April 2015, shortly after Islamic State militants in Libya beheaded dozens of Egyptian Christians. The video prompted calls by angry Muslims to evict the students and the teacher from their village. Mobs attacked the students' houses and security forces arrested the students while the teacher and his family were ordered to leave the village after a meeting of the village elders.

Christians make up approximately 10 percent of Egypt's population. They have long complained of discrimination by the Muslim majority. Christians were among the main supporters of the army chief-turned-president, Abdel-Fattah el-Sissi, who led the military ouster of Islamist President Mohammed Morsi amid mass protests against Morsi's rule.

"I voted for el-Sissi against Islamists," Girgis said, "is this the price?"

El-Sissi has vowed to purge extremism from Egypt's religious discourse, yet Egypt has witnessed a spike in blasphemy charges in recent months.

A female writer, Fatma Naoot, was sentenced to three years in prison in January after she was found guilty of contempt for Islam over a Facebook post criticizing the slaughter of animals for the Muslim feast of Eid al-Adha. She has appealed the ruling.

Last December, a court of appeals confirmed a prison term for a TV host and researcher, Islam Behery, who was convicted of "defaming religious symbols" and Muslim scholars after he called for the removal of passages from religious texts which he said supported extremism. The court in December reduced his prison term to one year from an initial five-year sentence.

Rights groups, including Human Rights Watch, have called on Egyptian authorities to end prosecutions based on contempt of religion laws. A recent HRW report documented 27 such court cases between 2011 and 2014.