The death toll from a fire at a children's shelter in Guatemala has risen to 38.

The fire broke out in a tiny room where the victims had been locked after a riot.

There were 52 teenage girls packed into the 16 square metre classroom when Wednesday's blaze broke out at the Virgen de la Asuncion home in San Jose Pinula.

The shelter provides a home for children who have suffered abuse, homelessness, or have completed sentences at youth detention centres and had nowehere else to go.

The youths who survived suffered such severe burns that specialists were flown in from Texas, and it is hoped that four of the girls will be flown to the US for treatment.

Hundreds of blood donors were needed, medics said.

At least 10 girls remain in critical conditions.

The government has sacked the director of the now temporarily closed centre.

Various groups have said they plan to protest on Saturday over the deaths and demand the resignation of the country's President Jimmy Morales.

The President has blamed the government's "rigid" and "insensitive" system for dealing with troubled youths and has promised to reform protective services for some 1,500 minors currently living in youth shelters around the country.

President Morales blamed the Guatemalan state during a Friday news conference for the tragedy and said that all of the government institutions in charge of minors played a role.

Claudia Lopez, Guatemala's deputy ombudsman for human rights, said: "The staff left the girls in an extremely reduced space, a four-metre by four-metre room, for 52 teenage girls. It was a terribly thought out decision."

Police and witnesses say the fire appeared to have been started by one of the girls, who set light to a mattress in the room, possibly as a protest after hours inside.

Ms Lopez added: "If it really was the girls who started the fire - why did they have matches in their hand, why were they not searched if they were going to be locked into this tiny space?"

The riot began when a group of teenagers complaining about the conditions inside feigned a fight in the lunch hall as a distraction, before attacking staff and trying to escape, one eyewitness said.

After hours of rioting, police captured most of those who had fled and they were separated from the hundreds of other residents in the complex, according to an account written by the government's human rights department.

During five hours of negotiations that evening, the leaders of the rebellion alleged abuse by the staff including rotten food and the use of bleach on their skin and pepper spray as punishment for bad behaviour, according to the document.

At around 1am, the 52 girls were locked into a classroom and given thin mattresses to sleep on, local police chief Wilson Maldonado told a congressional commission. Boys involved in the trouble were kept in a separate area, an employee at the home said.

At about 9am, police stationed outside the room noticed smoke seeping out, Maldonado said. However, one witness said the fire started 30 minutes earlier and police initially ignored the cries for help, thinking the girls were protesting.