Three days of national mourning have been declared in Guatemala, after 21 girls were killed in a fire, apparently started in protest against abuse at a crowded children's care home.

A crowd of relatives, many of them wailing with grief, continue to gather late on Wednesday (local time) outside the Virgen de Asuncion home, in the municipality of San Jose Pinula, some 25km southwest of the capital Guatemala City.

Al Jazeera's David Mercer, reporting from San Jose Pinula, said an investigation is under way, to determine what caused the fire.

Our correspondent also reported that the surviving children were being transferred to other care centres and orphanages.

READ MORE: People-power and the 'Guatemalan Spring'

The head of Guatemala's social welfare agency, Carlos Rodas, said youths at the shelter started rioting on Tuesday in an effort to escape.

Complaints about abuse and living conditions at the overcrowded shelter have been frequent.

Then on Wednesday, about 9am, "Some of the adolescents lit their mattresses on fire," Rodas said. "We don't shirk responsibility, we accept it, but we can't get those lives back."

Julia Barrera, spokeswoman for the prosecutor's office, said at least 21 children and teenagers perished.

Two hospitals said they received 41 injured girls between the ages of 13 and 17, many with second- and third-degree burns. Some of the injured had life-threatening burns.

"This is a painful situation," Nery Ramos, the head of Guatemala's national police, said at the scene of the fire.

Riot police had been sent in to quell unrest over the crowded living conditions at the home, which was created to house children who were victims of abuse, homelessness or who had completed sentences at youth detention centres and had nowhere else to go.

Some 40 residents escaped but were recaptured and isolated, Ramos said.

UNICEF and the prosecutor for human rights called for the home's closure last year after complaints of overcrowding along with physical and sexual abuse.

On Wednesday, UNICEF representatives were present as the police started the investigation, Al Jazeera's correspondent said.

Guatemalan media reported that more than 500 people were crammed into the shelter designed to house 400.

'Immediate closure'

The facility has previously been the target of multiple complaints alleging abuse, and several children have run away.

Guatemala's prosecutor for upholding children's rights, Hilda Morales, told reporters she was requesting that the shelter be closed due to welfare authorities' inability to manage it.

"We are going to ask for the immediate closure of the centre, and attribute administrative and criminal responsibility against those in charge of the centre for not fulfilling their duty," she said.

She noted that last year the Inter-American Commission on Human Rights had found in favour of several adolescents who had alleged maltreatment and sexual abuse in the shelter.

She stressed that those sent to the centre should receive "better protection" than in their families where they were abused.

Another prosecutor tasked with protecting children in the country, Harold Flores, told Emisoras Unidas that since last year complaints had surged against the shelter over minors running away to escape alleged sexual abuse there.

He said an investigation had been started to find the reasons and those responsible for Wednesday's tragedy.

Meanwhile, Al Jazeera's Mercer reported that critics are accusing the government of not doing enough to address the complain of the residents of the care home.