Footage showed a boy spraying his clothes with deodorant then lighting it
A fire officer has condemned "the Jackass generation" of young people, who he said are copying dangerous stunts seen on cult TV shows.
Mick Flanagan, of South Wales Fire Service, said he was aware of "too many" youths setting their clothes on fire, imitating shows such as Jackass.
In one incident, pupils from Llanishen High School, Cardiff, filmed themselves spraying aerosols onto their uniforms and lighting them.
The school is investigating.
The incident emerged after footage appeared on YouTube, although it has since been taken down after the video sharing website was contacted by the South Wales Echo newspaper.
In one clip, a schoolboy's chest was seen covered in flames after lighting his deodorant-soaked polo shirt.
Another clip showed a boy lighting the crotch area of his trousers while in a classroom full of pupils.
Llanishen High School's headteacher Robert Smyth said: "These are incidents that seemingly date back to September 2009 and are clearly acts of gross irresponsibility and stupidity which could have resulted in serious injury.
"We will be investigating these incidents and will take appropriate action as necessary under the school's positive behaviour policies."
Mr Flanagan, who is the head of the fire crime unit and also heads up the fire investigation team, said "sadly" he had seen many such incidents posted on various video sharing sites.
"It's what we call 'the Jackass generation'. They watch shows like Jackass and Dirty Sanchez then do exactly what they are told not to do [by the programmes] and copy what they see," he said.
"These are TV programmes where you see adult men pulling these stunts. It's all well and good and funny - but they have been rehearsed, risk assessed and have a safety team on standby.
"Unfortunately there's a world of difference with what we're seeing with these pupils. They are doing this in a public building and not only putting themselves at risk but others too."
He said he had seen other instances of young people setting themselves on fire, filming it and posting the footage online.
"I've seen people igniting themselves with some really dangerous things, like petrol, aftershave, alcohol... It's unbelievably foolish," he said.
"They won't find these stunts so amazing if they end up burned and scarred for life - that's if they survive them."
He said the fire service visited all schools in the region to educate pupils about the dangers of fire.
"The vast majority of young people are decent kids and intelligent enough to know not to do it," he added.
"Unfortunately there will always be an element who do it and they film themselves to try to gain notoriety at school. But most people just think they're stupid."