Rio de Janeiro: A Brazilian nursery school guard burned six small children and a teacher to death after spraying them with alcohol and setting them alight on Thursday in an attack that has horrified the nation.

Dozens of people were also hurt in the blaze while the guard, who was reported to be mentally ill, died after succumbing to his own burn injuries.

The tragedy occurred in a modest quarter of Janauba, a city of 70,000 about 600 kilometres north of Belo Horizonte city.

The nursery was called Innocent People.

The initial death toll of four rose to six when two badly burned children died, according to news reports that quoted fire department officials.

Janauba’s mayor decreed seven days of mourning.

About 50 people were hospitalised with injuries, said Bruno Ataide Santos, director of the local hospital.

Hours later, 10 people remained hospitalised in serious condition.

The guard, who was aged about 50 and identified as Damiao Soares, died in hospital several hours after the incident, which left him with burns all over his body, Santos told AFP.

About 80 children were in the nursery school when the attack occurred, prompting terrified parents to rush to the school, where they found one classroom reduced to ashes.

“As the creche is near our house we heard noise and rushed over,” Nelson de Jesus Silva, the father of one victim, told Globonews TV.

“My little girl was so good, so smart,” he said of his dead daughter, Ana Clara Ferreira.

Grief also struck Jane Kelly, the mother of Juan Miguel Soares.

“I was thinking of changing nursery schools because we are preparing to move. I woke him up early to bring him here and when I saw him again he was dead in the hospital,” Kelly said between sobs.

The dead children were aged four, the G1 news site reported.

Police visited the home of the suspect and his family members to try to determine a motive.

But police superintendent Renato Nunes told the website of the Hoje em Dia newspaper that the guard had had mental health problems since 2014.

The guard had worked nights for at least eight years at the nursery school, where he was not directly in contact with the children.

Janauba’s mayor Carlos Isaildon Mendes said an even greater tragedy was narrowly averted.

“This could have been worse because the babies’ room was in the hall next door. Evacuation would have been more difficult. As the children were bigger a lot of them were able to escape,” the mayor explained.

Police searched the guard’s home and found many jugs of alcohol. He reportedly told his family this week — which includes the anniversary of the death of his father — that he was going to give a “gift” to them and that he would die.

Brazil’s President Michel Temer expressed his condolences on Twitter.

“I am deeply saddened by this tragedy involving children in Janauba, and I want to express my solidarity with the families,” Temer wrote.

As the father of a school-age child, Temer said he understood “this must be an extremely painful loss” for the parents.