A British DJ has been sentenced to a year in jail by a Tunisian court after he played a remix recording of the Muslim call to prayer in a nightclub.

The London-born Dax J, who left Tunisia after last weekend’s incident, was charged with public indecency and offending public morality, said Ylyes Miladi, a spokesman of a court in the town of Grombalia.

Tunisian authorities shut down the nightclub in the north-east town of Nabeul and began an investigation after a video, widely shared on social media, showed clubbers dancing to music that included the call to prayer, sparking a storm of debate.

“We will not allow attacks against religious feelings and the sacred,” the governor of Nabeul, Mnaouar Ouertani, said when the club was shut down.

The event was part of Orbit festival, near the popular resort of Hammamet, and two European DJs played at the party. Organisers apologised but said they took no responsibility for the offensive tune.

“Dax J is English and played the track recently in Europe,” they said, adding that he did not realise “it might offend an audience from a Muslim country like ours”.

The DJ also apologised. “I want to offer my sincere apologies to anyone who may have been offended by music that I played at Orbit festival in Tunisia on Friday,” Dax J said. “It was never my intention to upset or cause offence to anybody.”

The court dismissed charges against the nightclub owner and an organiser of the event in the coastal resort, but the prosecution has appealed saying the two should have checked what the DJ would be playing.

Tunisia’s religious affairs ministry has said: “Mocking the opinions and religious principles of Tunisians is absolutely unacceptable.”

It is unlikely that the Berlin-based Dax J, who has performed at festivals all over the world, including Glastonbury, will serve any time in prison.