The attack is reported to have happened at around midday local time on Thursday.
A mass shooting and knife attack has killed at least 37 people, including children, at a nursery in northeast Thailand.
The gunman, a 34-year-old former police officer, killed his wife and child before shooting himself dead, police said.
The attack is reported to have happened at around midday local time on Thursday in Nong Bua Lamphu, a small town near the border with Laos.
Twenty-two children and two adults were killed in the building before the assailant fled, according to a police statement.
The gunman then continued shooting from his car, killing another two children and ten adults, including his wife and child.
Twelve people were also injured, three of them seriously, police colonel Jakkapat Vijitraithaya said.
Around 30 children were at the daycare centre when the gunman entered at around lunchtime, district official Jidapa Boonsom told Reuters.
"At first, people thought it was fireworks," she added.
Thai police earlier named the gunman, who they said fled the pre-school daycare centre in a white pickup truck, as Panya Kamrab.
Police said that Kamrab was sacked from the regional force last year for drug-related reasons, according to Reuters.
The town's hospital wrote on Facebook that it urgently needed blood donations after the incident.
The country's prime minister Prayut Chan-O-Cha has ordered an investigation into the "horrific" massacre and is due to travel to Nong Bua Lamphu on Friday.
"I would like to express my deepest condolences to the families of the lost and injured," he wrote on Facebook.
Gun ownership rates in Thailand are high compared to other countries in the region but official figures do not include huge numbers of illegal weapons.
Mass shootings are rare in Thailand but in February 2020, a soldier killed at least 29 people and wounded 57 in a rampage that spanned four locations.
The country's gun laws are strict and possession of an illegal firearm carries a prison sentence of up to 10 years, but ownership is high compared with other countries in Southeast Asia.