A teen girl who had her phone confiscated set her school dormitory on fire, police say. 19 children died.

A dormitory blaze that killed 19 children in Guyana was set by a teenage student who was upset that her cellphone had been taken away, officials say.

The fire broke out at the Mahdia Secondary School in the South American country late on Sunday. A statement from the Guyana Fire and Rescue Service said the blaze was “maliciously set.”

National Security Adviser Gerald Gouveia told the Associated Press that the suspect in the incident, a pupil at the school, was accused of setting the dorm on fire after being disciplined for having a liaison with an older man.

“A female student is suspected of having set the devastating fire because her cellular phone was taken away by the dorm mother and a teacher,” Mark Ramotar, Guyana Police’s communications chief, said in a statement.

The AP reported that the dormitory had been locked to stop the girls from sneaking out at night.

Gouveia told the AP that the house mother had been asleep inside the building and panicked when she could not find the keys to unlock the doors. She made it out but “lost her five-year-old child in the fire,” he said.

When firefighters arrived, the wood-and-concrete building that housed the 57 children was “engulfed in flames,” the fire service said.

The building’s windows were heavily barred and five doors were locked, it added.