Thirty-seven people have been killed, most of them young children, in an unprecedented gun and knife attack at a preschool centre in north-east Thailand that has horrified the country.

The attacker, a former police officer, opened fire as children were sleeping at the centre in Na Klang district in Nong Bua Lamphu province at about noon on Thursday, police and witnesses said.

Police said most of the children killed at the centre were stabbed to death. As he left the nursery the attacker drove his car towards and shot at bystanders

He then returned home, where he shot himself, his wife and his child. he attacker as Panya Khamrab, a 34-year-old former police lieutenant colonel who had been dismissed from the force last year

He was dismissed from the force last year for methamphetamine possession and had appeared in court earlier on Thursday on a drugs charge.

Images from the scene showed a nursery schoolroom, its walls covered in alphabet letters and paintings of animals. The bodies of children lay on sleeping mats, with white sheets placed over them.

A teacher who spoke to Thai Rath TV said she saw Panya open fire in the car park before walking towards the centre.

“I was begging [for him to stop] but he was loading the bullet so I ran to the back and we closed the door, we ran out of the window,” she said. The children, aged between two and four years old, were sleeping at the time, she said.