Algeria is embroiled in scandal after a prominent atheist author was urged to recite the shahada and pray to God before being questioned by a fake police officer in a television sting that ended in a scuffle as he attempted to leave.

Rachid Boudjedra, 75, was told by presenters on the private channel Ennahar TV to shout "Allahu Akbar" and recite the shahada (the profession of Muslim faith), while shouting at him.

A fake policeman then intervenes to ask for Boudjedra's papers, before asking him questions about his faith.

The writer is then seen shouting at the presenters and being blocked from leaving the studio before, leading to a confrontation with staff.

Boudjedra has previously controversy by declaring in 2015 on Echorrouk, another Algerian TV channel, that he was an atheist.

The sting provoked a wave of protests on social networks and three petitions were created to denounce the actions of Ennahar TV.

Many called for the closure of the channel, which they said was a megaphone of the system and socially regressive.

Ennahar est un appareil d'avilissement généralisé de l'Algerie. Instrument d'une prise d'otage, d'un chantage. Boudjedra mais pas seulement — Kamel DAOUD (@daoud_kamel) June 1, 2017

Translation: Ennahar debases Algeria. It is an instrument of blackmail, and not only Boudjedra.

The writer and former publisher Lazhari Labter called on advertisers to boycott Ennahar TV.

Activist Djilali Hadjadj denounced Ennahar TV as "a fascist wing of the police".

Islamic scientist Said Djabelkhir wondered if the situation "did not push intellectuals to take up arms".

Hidden camera stings are a mainstay of Algerian television, especially during Ramadan as channels try to outdo each other. Scenes usually end in fights.

Three petitions, two in Arabic and one in French, were launched on Thursday.

Social media posts supporting the petitions call for an investigation into what it described as "barbaric and violent behaviour towards the great author".

The French petition states: "One of the most illustrious Algerian authors alive has suffered humiliations and taunts."

It said Boudjedra was "abused and pushed to extremes, forced to claim that he is a Muslim - we are not far from the scenes of IS?"

On Thursday, the director of Ennahar TV apologised to Boudjedra. According to his relatives, the author has filed a complaint.

This article was translated from the original French.