Two students are in fair condition with burns after a demonstration in a chemistry classroom in Northern Virginia sparked an explosion on Friday.

The blast Friday morning at W.T. Woodson High School in Fairfax, Virginia, was accidental and occurred as a teacher performed an experiment, Fairfax County Fire Chief Richard Bowers said.

"It was a demonstration of fire in the different colors," Bowers said. "The students were observing the experiment when the explosion occurred."

The exact nature of the experiment performed at Woodson wasn't known immediately.

An exercise often known as "the rainbow experiment" has previously left students with serious injuries and should not be performed in classrooms, according to the U.S. Chemical Safety Board and the American Chemical Society.

"These demonstrations present an unacceptable risk of flash fires and deflagrations that can cause serious injuries to students and teachers," the ACS said.

In New York City, a botched rainbow experiment -- which shows how various mineral salts produce flames in different colors when mixed with highly flammable methanol -- left a 16-year-old high school student with serious injuries in January 2014. In Hudson, Ohio, the same experiment left a 15-year-old prep school student and model with devastating burns in January 2006.

Woodson student Daniel Dorlester said he was in the classroom full of 30 10th grade students when the blast erupted about 9:40 a.m.

"It was kind of a fireball, but it wasn't like a 'whoosh' thing that went up, it went out," he said. "[The teacher] decided to add more alcohol straight from the bottle, and at that point, it blew up and everyone started evacuating."

Dorlester made it out of the room unhurt, though a sweatshirt he had left elsewhere in the classroom went up in flames.

"I didn't know what to think of it, I just knew that I needed to get out of there," he said.

Three other students had less serious, non-life-threatening injuries. They were taken to Inova Fairfax Hospital and had been released by 4 p.m. Friday.

Fire and school officials give an update on a fire that injured six people at a Virginia high school.

The teacher also sustained minor burns and was treated on the scene. She stayed at the school to talk to authorities, Fairfax Fire Capt. Randy Bittinger said.

"Again, non-life-threatening, but she does want to make sure that she lets everybody knows what occurred and gets that investigation taken care of," Bittinger said.

Officials said 50 percent of the chemistry classroom was damaged by water, smoke and fire. The fire caused $7,500 in damage, Bowers said.

One teacher and five students are injured after a classroom fire. Two students are experiencing life threatening injuries.

"It was a small fire," said Dan Schmidt, from the Fairfax County fire department, said. "Firefighters, along with the sprinkler system, put out the fire."

The school was evacuated after the fire, which was contained to a single room. A hazmat team evaluated the school.

"Anything to take precautionary measures is, I think, the recommended route when it comes to the safety of children and students," Schmidt said.

Chopper4 footage showed evacuated students gathering near the football field outside the school. Other students were taken to tennis courts.

Friday was the last day of the marking period, so students had been scheduled for early dismissal even before the fire occurred, said John Torre, a spokesman for Fairfax County Public Schools. Students were dismissed at 12:55 p.m., their scheduled time. Parents were notified of the situation, Torre said.

FCPS Superintendent Karen Garza said in a release Friday that she was "deeply saddened" by the injuries.

"FCPS is truly like a family, and as such, we are all deeply concerned about what happened today," Garza said in the release. "I know this incident has affected the Woodson community and, as a district, we will provide as much support and assistance for students, staff members, and families as is needed."

She also praised "the quick and calm actions of the Woodson leadership and staff" in conducting a safe evacuation.

Orchestra teacher Kathy Thompson said some students were in tears and eager for updates about their classmates.

"They're glued to their phones, trying to get whatever information through social media that they could," she said.

Fairfax Co. PD Chief: No evidence of criminal activity. Fire Marshal investigating cause. #WoodsonHS @nbcwashington pic.twitter.com/krSHomlZKJ — Meagan Fitzgerald (@MeaganNBCDC) October 30, 2015

Resident Nancy Cappel headed to a varsity football game at Woodson Friday night, which was played despite the accident. Cappel said several Woodson students headed to St. Matthew's United Methodist Church in Annandale to meet with Cappel and a counselor.

"This school is very much hurting," she said.

The crowd at the Woodson versus West Springfield High School game Friday night was subdued. In the end, Woodson won 35-28.

Stay with NBCWashington.com and News4 for more on this developing story.