His Majesty the King will provide assistance to families of the victims from Thursday's massacre at a child development centre in the northeastern province of Nong Bua Lam Phu that left 38 dead and another 10 injured, national police chief Pol Gen Damrongsak Kittiprapas said.
The death toll includes the killer, his wife and their 3-year-old son, who the perpetrator also shot.
Pol Gen Damrongsak said a privy councillor representing His Majesty was scheduled to arrive in the province to follow up on the situation.
"His Majesty the King will provide help to the families of the deceased and injured," the police chief said.
According to police, 24 of those killed in the rampage at the centre were children, after former Pol Sgt Panya Khamrab burst into the childcare facility operated by the Uthai Sawan tambon administrative organisation in Na Klang district.
At least another 10 were injured, six of them seriously, police said.
The shooting began at 12.10pm. The gunman's exact motive remains a mystery. Police said former Pol Sgt Panya, 34, was expelled from the force on June 15 for possession of methamphetamine pills.
He was arrested five months earlier on Jan 20, when he reportedly confessed to the charges.
Pol Sgt Panya fled the scene in his pickup after the carnage.
The Central Investigation Bureau posted on its Facebook page that the gunman later shot himself, his wife and his child inside his house while surrounded by police.
Prime Minister Prayut Chan-o-cha expressed his deepest condolences to the bereaved families.
He also said he had instructed the Social Development and Human Security Ministry to step up its compensation payments to them.
Deputy national police chief Pol Gen Torsak Sukwimol said the mother of the gunman told him her son had gone to court to attend a hearing on his drug case on Thursday morning, just prior to the shooting.
After leaving the court, he appeared stressed out, took some narcotics and started to feel paranoid, Pol Gen Torsak quoted the mother as saying, adding the woman said he then grabbed his gun and headed to the child development centre.
Pol Gen Torsak said the gunman opened fire while children in the centre were sleeping and he also used a knife to attack and kill many of his victims.
The court is scheduled to hand down a ruling in the drug case on Friday, police said.
Pol Maj Gen Archayon Kraithong, spokesman for the Royal Thai Police, warned netizens not to share clips or pictures of the shooting to avoid deepening the traumatic experiences suffered by the families of victims as well as people in the local community.
Pol Maj Gen Paisarn Luesomboon, spokesman for the 4th Provincial Police Region, said the gunman likely held a grudge after he was sacked, reinforced by the effects of drug abuse, yet it was still unclear why he chose that target. Possibly it was because the kids were a vulnerable target, he said.
According to police, after the shooting the gunman drove a pick-up truck to his home in Na Wang district five kilometres away, running into other people's vehicles along the way.
Some foreign leaders also expressed their condolences.
British Prime Minister Liz Truss tweeted: "I am shocked to hear of the horrific events in Thailand this morning. My thoughts are with all those affected and the first responders. The UK stands with the Thai people at this terrible time."
Australian Prime Minister Anthony Albanese posted the following message on Twitter: "It's impossible to comprehend the heartbreak of this horrific news from Thailand. All Australians send their love and condolences."
Thursday's rampage was the worst mass shooting in the country since a soldier opened fire at the Terminal 21 shopping mall and other locations in Nakhon Ratchasima on Feb 8, 2020.
In the 2020 massacre, the gunman killed 29 people and wounded 58 others before being shot dead.