A 9-year-old girl suffered serious burns after accidentally setting herself on fire with a lighter at her Brooklyn school Wednesday, according to sources.

The girl was playing with a lighter she’d found in the third-floor bathroom at Excellence Girls Charter School in Bedford-Stuyvesant when her school uniform went up in flames around 2:30 p.m., sources said.

School officials called 911 after the victim began screaming, sources said.

She was taken to the burn center at NewYork-Presbyterian/Weill Cornell in Manhattan with second- and third-degree burns to 40% of her upper body.

The girl is currently in stable condition.

No one else was injured.

A mom whose daughter is in the third grade at Excellence cheered the school for how it handled the scary incident.

“Kids do things, I don’t blame the school. It’s a really good school. They love my child. They are always in communication with us,” said the mom, who didn’t want to be named. “She’s a little girl, they pick up things.”

Excellence spokeswoman Barbara Martinez said the school is focusing on supporting the student and her family, as well as the school community.

“We are working with the authorities and will continue to communicate with and support our families and students,” she said in a statement.

Additional reporting by Joe Marino