Updated

A nighttime fire at a dormitory of a primary school in northern Thailand killed 18 girls, many of whom had been roused by a dorm-mate but went back to sleep, thinking it was a prank, officials and the girl who sounded the alarm said Monday. The victims were between 5 and 12 years old.

Five girls were injured in the Sunday night fire. Many survived by rappelling down from a second-floor window using sheets tied together to form a rope.

The two-story wooden structure that caught fire housed 38 girls, most of them belonging to the area's ethnic minorities. Fifteen girls escaped without injuries. The cause of the fire was not immediately known.

Some of the students were still not asleep when the fire broke out and were able to raise the alarm, said Rewat Wassana, manager of the Pithakkaiat Witthaya School, to which the dorm is attached.

The kindergarten and primary school in Wiang Pa Pao district, just outside the city of Chiang Rai, has about 400 day students and boarders. It is about 500 miles north of Bangkok.

Rewat said the fire broke out in the dorm's lower level, which is used for activities. The upper level housed the sleeping quarters. It is one of the two dorms on the 20-acre school grounds. The other dorm, which is located nearby and is for boys, was untouched, Rewat said.

"We have a teacher who sleeps with the girls in the dorm. She tried to help the students escape," Rewat told reporters at a news conference broadcast on local television.

An 11-year-old girl identified only as Suchada said at the same news conference that she had gotten up to go to the bathroom when she noticed the fire downstairs, and ran to tell her friends in various rooms. But some of them didn't believe her and closed the door on her to go back to sleep, she said.

"We remembered some lessons from Girl Scouts to tie cloth together to make a long rope and we climbed out of the window," the fifth-grade student said. "The teacher helped us. While the teacher was climbing down, the rope tore and she hurt her leg and waist."

A police official told The Associated Press by phone that besides the 18 dead, another five girls were injured, including two in serious condition. He said two of the bodies were so badly burned they were unidentifiable. The official did not wish to be identified because he was not authorized to speak to the media.

Firefighters took three hours to extinguish the fire, and pulled survivors and bodies from the second-story window of the wooden building.