Investigators in Guyana believe a fire that killed 19 mostly girls trapped in a school dormitory was deliberately set by a student who was upset that her mobile phone was confiscated, a top official said Tuesday.

The suspect in the fire late Sunday, who is among several injured people, had been disciplined by the dorm administrator for having an affair with an older man, National Security Adviser Gerald Gouveia said. The student allegedly threatened to torch the dorm and later set a fire in a bathroom area, Gouveia said.

The fire raced through the wood, concrete and iron-grilled building after it had been locked for the night by the dorm administrator — or house mother — to prevent the girls from sneaking out, Gouveia said.

"She did this out of love for them. She felt she was forced to do so because many of them leave the building at night to socialize," Gouveia told The Associated Press. "This is a very sad situation, but the state is going to work with the students and the families to provide all the support they need."

AT LEAST 20 STUDENTS KILLED IN GUYANA DORMITORY FIRE

All but one of the victims were Indigenous girls aged 12 to 18 from remote villages served by the boarding school in Mahdia, a mining community near the Brazil border. The remaining victim was the five-year-old son of the house mother.

Many of the victims were trapped as the building burned, though firefighters were able to rescue people by breaking holes through one of the walls.

Guyanas Department of Public Information

The dormitory of a secondary school is shown following a fire in Mahdia, Guyana, on May 22, 2023. A fire raced through the dormitory early on May 22, 2023, killing at least 19 students and injuring several others. (Guyanas Department of Public Information via AP Photo)

"The house mother was asleep at the time inside the building but panicked and could not find the right keys to unlock the building from inside but she made it out. She also lost her five-year-old child in the fire," Gouveia said.

Many of the nine people hospitalized are in serious condition.

HOUSE LAWMAKERS FOCUS ON 'OUTCOMPETING CHINA' IN BIPARTISAN VISIT TO GUYANA

Police were expected to charge the man who had the relationship with the student with statutory rape because she was under 16, Gouveia said.

Guyana’s government has accepted offers from the US to send forensic and other expert teams to help with the investigation, Gouveia said. The government also was sending specialists in DNA identification to help identify remains of 13 of the 19 victims who died at the scene.

"Leaders from all over the world have been offering to help us at this time. They were calling and messaging President Ali (Irfaan) while he was on the ground in Madhia on Monday," Gouveia said.

Madhia is a gold and diamond mining town about 200 miles from the capital, Georgetown.

CLICK HERE TO GET THE FOX NEWS APP

Deputy Fire Chief Dwayne Scotland told the AP that more lives could have been saved if the service had been informed of the blaze sooner. When firefighters arrived, local residents were unsuccessfully struggling to douse the blaze and evacuate people, he said.

"The building was well engulfed," he said.

This week’s dormitory fire outranked what had been the country's deadliest fire in recent times, when 17 inmates were killed at the main Georgetown prison in 2016. Angry over trial delays and overcrowding, some inmates set fire to the building, built to house 500 but containing 1,100, resulting in the deaths of the 17 and severe injuries to about a dozen others.