BANGKOK: The perpetrator behind a gun and knife attack in Thailand that killed at least 34 people had attended a court hearing on a drugs charge prior to opening fire at a day-care centre, police said on Thursday.

The attacker was agitated when he arrived at the day-care facility to find his child was not there and left, then shot at bystanders and drove his vehicle at them, Paisan Luesomboon, a police spokesperson, told ThaiPBS television. He said the attacker returned drove home and killed his wife and child.

The victims included children as young as 2 years old, a local police official said on Thursday.

Chakkraphat Wichitvaidya, superintendent of Na Klang police station, also told Thai Rath TV that the gunman had been discharged from the police force last year.