They came from all over conservative Algeria, clad in black leather, studded bracelets and even traditional Muslim veils, to revel in a rare heavy metal festival.

Held in Constantine, designated this year’s Capital of Arab Culture by the Arab League and Unesco, the two-day Fest 213 brought together metal fans from across the country.

Headbanging and mosh pits may seem incongruous in Algeria, where the government prefers to promote traditional music and events that bolster its Arab-Muslim identity.

But the country has had a solid core of metal fans for more than two decades and, despite occasional media charges of “devil worship”, the music is attracting a new generation of followers.

“This is really unprecedented,” said a young woman from Constantine, who called herself Sadness Spirit at the event, which shares its name with Algeria’s international dialling code.

Dressed in black leather, with piercings and dyed-red hair, she was waiting for a concert to begin, accompanied by a friend with her own piercings but also wearing a Muslim veil.

Nearby stood a group of young men dressed in black T-shirts, their arms tattooed and their hair slicked back with gel. “Outside of concerts we don’t dress this way or act this way, to avoid trouble,” said Sadness Spirit.

Algerian rock group Traxxx play during the two-day festival held earlier this month. Photograph: STR/AFP/Getty Images

The festival featured five bands – Franco-Algerian acts Acyl and Arkan and homegrown outfits Traxx, Fingerprints and Numidas.

Algerian metal is a far cry from the Raï pop music, which also originated in the country. Metal first emerged there in the 1990s, during a decade marked by a devastating war between the government and Islamists, which eventually claimed 200,000 lives.

With authorities preoccupied with battling extremism, an underground metal scene flourished largely unnoticed. More recently it has come under fire from conservatives, who accuse the music of corrupting Algeria’s youth.

El Biled, a conservative television channel, launched an attack on metal fans last summer, accusing them of being “devil worshippers”.

The channel broadcast a documentary featuring fans discussing black magic, with images of skulls flashing in the background.

The documentary prompted a backlash from metal aficionados on social media, with one Facebook page urging supporters to adopt the slogan “I’m a metalhead and a Muslim”.

Artists have also accused the government of using its control over concert venues to limit their performances, blocking some bands and telling others to change their lyrics.

The band Traxxx are from the northern central city of Tizi Ouzou. Photograph: STR/AFP/Getty Images

Malik Chaoui, an Algerian cultural activist, said the government too often promotes “cultural policies that aim to control thought” and needs to accept more diversity.

For now, followers of Algerian alternative music scene are doing what they can outside the mainstream. Social media is being used for promotion and finding independent associations willing to help organise events.

In Algiers, a group of young people have set up a group called Mayhem to help promote musicians who play rock, metal and blues. It has already arranged for performances on the terrace of the capital’s Museum of Fine Arts.

“Officials consider these movements as too westernised and not profitable, but in fact a metal concert brings in a lot of people,” said 21-year-old member Zakaria Brahami.