A French mayor backed by the far-right Front National has been accused of racism after using the names of schoolchildren in his town to decide how many were Muslim.

Under France’s strict secularism laws, the government does not keep statistics on people’s religion or ethnicity.

But Robert Ménard, mayor of Béziers in the south of the country, said his administration had used lists of pupils’ names to decide how many were Muslim, and claimed the figure came to 64.6%.

“Sorry to say this, but the mayor has, class by class, the names of the children,” he said on France 2 television on Tuesday night.

“I know I don’t have the right to do it. Sorry to say it, but the first names tell us their religion. To say otherwise is to deny the evidence,” he added.

His comments brought condemnation from the Socialist government, with the prime minister, Manuel Valls, tweeting: “Shame on the mayor”.

“The Republic does not make any distinction between its children,” Valls said.

The education minister, Najat Vallaud-Belkacem, said she had called for a judicial investigation, saying Ménard’s statements were “profoundly anti-Republican”.

“I am scandalised, sickened by these comments,” added Abdallah Zekri, head of the National Observatory Against Islamophobia.

“Moreover, you can be called Mohammed without being a practising Muslim,” he added.

However the town hall of Béziers denied on Wednesday that there was any list of children’s names or that any effort had been made to identify which were Muslim.

“The town hall of Béziers does not have, and has never had, files on its children,” it said in a statement.