A Brazilian guard allegedly set fire to a childcare on Thursday, burning four toddlers and their teacher to death, in Janauba town of Minas Gerais state, BBC reported.

Twenty-five children, mostly aged four or five, were injured and were being treated at a local hospital for burns.

The security guard, identified as 50-year-old Damiao Soares dos Santos, died of his wounds in the hospital. He was reportedly mentally ill, and had been dismissed from service last month. He had gone to the childcare to hand in a medical certificate when he started the fire, local media reported.

Janauba’s Mayor Carlos Isaildon Mendes has announced seven days of mourning. Brazilian President Michel Temer expressed him sympathy. “I’m very sorry about this tragedy involving children in Janauba…I want to express my sympathy to the families,” he tweeted.

“This could have been worse because the babies’ room was in the hall next door…Evacuation would have been more difficult,” Mendes said, AFP reported. As the children were bigger, a lot of them were able to escape he added.