(Bloomberg) -- A mass shooting that began with a daycare center in northeastern Thailand left 38 people dead, the majority of them children, according to officials. 

A 34-year-old former cop used an automatic weapon to fire at the center located in Nong Bua Lamphu province near Thailand’s border with Laos on Thursday afternoon, killing 24 children, Jackrapat Wijitwaitaya, a local police official, said by phone.  

After fleeing the scene, the assailant shot dead more people as he drove back to his house, where he killed his wife and child before taking his own life, Jackrapat said. The attack also left 10 injured, six of them seriously, according to Surachate Hakparn, deputy chief of the Royal Thai Police.

The motive behind the crime was unclear but the shooter, identified as Panya Kamrab, was believed to be under the influence of drugs, Jackrapat said. 

National police chief Damrongsak Kittiprapas, who flew to the site of the attack, said the shooter was fired from service after being arrested for possession of drugs. 

The assailant was set for a court appearance on Friday in the drug case that led to his dismissal, Damrongsak said. 

Prime Minister Prayuth Chan-Ocha ordered a probe into the “horrifying” crime and the police to fast-track the investigation. Authorities ordered the closure of all daycare centers in the area.

While mass shootings are not very common in Thailand, a soldier shot dead two of his colleagues at a military facility in Bangkok last month. Twenty-nine people were killed during a mass shooting in Nakhon Ratchasima in Thailand’s northeast in 2020.

(Updates death toll, adds comment from police from third paragraph.)

©2022 Bloomberg L.P.