Police said the children, who included toddlers as young as two, were mostly stabbed to death.
The other victims, all adults, included at least two childcare staff and one district official.
Photographs showed bodies of what appeared to be children covered in white sheets on the floor of the centre in Uthai Sawan, a town 310 miles northeast of Bangkok.
The attacker forced his way into a locked room where the children were sleeping, a district official said. She said a teacher who was eight months pregnant was also stabbed to death.
Police identified the knifeman as 34-year-old former sergeant Panya Kamrap, who was dismissed last year over drug allegations.
He had been in court earlier in the day on a drugs charge and had then gone to the centre to collect his child.
A local police chief said the main weapon he used was a 9mm pistol that he had bought himself.
“We are still investigating all of this and have to learn from it,” he said.
At least 34 dead in Thai children centre shooting
23 children among shootout victims
Gunman shot himself dead after attack
Gunman fled the scene after shooting, stabbing victims
Prime minister expresses condolences over deaths
14:24 , Jane Dalton
Police have identified the suspect as 34-year-old former police officer Panya Kamrap. Police Major General Paisal Luesomboon told PPTV that Kamrap was sacked from the force earlier this year because of drug-related offences.
He used multiple weapons in the attack, including a handgun, a shotgun and a knife.
Local police chief Damrongsak Kittiprapha said the suspect was a sergeant on the force before he was dismissed, and that the main weapon he used was a 9mm pistol that he had purchased himself.
“We are still investigating all of this and have to learn from it,” he said. “Today is the first day and we don’t have all the details.”
Killer bought gun legally
13:28 , Jane Dalton
The former policeman who killed 38 people had legally purchased the gun he used in the attack, police said.
He also used a knife.
Death toll at 38
13:25 , Jane Dalton
Police have now put the death toll at 38.
Police release details of gunman
12:59 , Sravasti Dasgupta
Police in Thailand have confirmed the identity of the gunman behind the daycare centre mass shooting in Nongbua Lamphu as 34-year-old former police officer Panya Kamrap.
Police Major General Paisal Luesomboon told PPTV in an interview that he was fired from the force earlier this year because of drug-related offences.
In the attack he used multiple weapons, including a handgun, a shotgun and a knife, police say.
'Gunman shot through the door'
12:32 , Sravasti Dasgupta
Witnesses in Thailand’s daycare centre shooting said that they had tried to prevent the gunman from entering but he had shot through the door.
A witness told Thailand’s Kom Chad Leuk television that they had locked the door to the building in the northeastern Thai town of Nongbua Lamphu, when they saw the suspect approaching with a handgun.
“The teacher who died, she had a child in her arms,” said the witness who did not want to be identified.
“I didn’t think he would kill children, but he shot at the door and shot right through it.”
Authorities have identified the assailant as a former police officer.
Attacker also used knife, continued firing from his car
12:15 , Stuti Mishra
More details are emerging about how the attack unfolded, revealing that the suspected shooter, identified as Panya Khamrab, a suspended police officer, also stabbed multiple victims.
The attacker was agitated when he arrived at the 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.
After the suspect fled, he continued to shoot from his car, hitting several people, Luesomboon told The Associated Press.
Eight-months pregnant woman among victims
12:05 , Stuti Mishra
One of the first victims of the attack on the nursery school was a teacher who was eight months pregnant, according to witness accounts and officials.
Nineteen boys, three girls and two adults were killed inside the nursery building before the assailant fled, according to a police statement.
Two children and 10 adults also died outside the childcare centre, including the suspect, his wife and his son.
Photos show distraught parents outside the nursery
11:50 , Stuti Mishra
More pictures from the site of the shooting in Nongbua Lamphu show parents standing outside the nursery while a distraught woman sits on the floor.
Video: Aftermath of Thailand daycare centre shooting
11:41 , Stuti Mishra
Videos and photos posted on social media carried the sound of wails as frantic family members wept and watched outside the nursery school building during the attack.
Some images showed white sheets covering what appeared to be the bodies of children, lying in pools of blood at the centre.
Gun laws in Thailand
11:30 , Sravasti Dasgupta
Gun laws are strict in Thailand, where possession of an illegal firearm carries a prison sentence of up to 10 years.
Firearm ownership is high in the country compared with some others in the region.
Firearm-related deaths in Thailand are much lower than in countries like the United States and Brazil, but higher than in countries like Japan and Singapore that have strict gun control laws.
The rate of firearms related deaths in 2019 was about 4 per 100,000, compared with about 11 per 100,000 in the US and nearly 23 per 100,000 in Brazil.
The last worst mass shooting in the country involved a disgruntled soldier who opened fire in and around a mall in the northeastern city of Nakhon Ratchasima in 2020, killing 29 people and holding off security forces for some 16 hours before eventually being killed by them.
Images show aftermath of mass shooting
11:15 , Sravasti Dasgupta
Images show scenes at a daycare centre in Thailand after a gunman opened fire in the town of Nongbua Lamphu on Thursday.
Gunman had been to court on drugs charge prior to shooting
11:00 , Sravasti Dasgupta
Thai police said that the gunman who opened fire in a children centre’s on Thursday had been to court on a drugs charge prior to the shooting.
Paisan Luesomboon, a police spokesperson told ThaiPBS television that 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.
He said the attacker returned home and killed his wife and child.
Children as young as 2 among victims
10:45 , Sravasti Dasgupta
Local police officials in Thailand’s northeastern province of Nong Bua Lamphu said that the victims of the mass shooting included children as young as 2 years old.
About 30 children were at the centre when the gunman arrived, fewer than usual, as heavy rain had kept many people away, district official Jidapa Boonsom, who was working in a nearby office at the time, told Reuters.
Gunman discharged from police last year
10:30 , Sravasti Dasgupta
According to police in Nongbua Lamphu, the gunman who shot and stabbed 34 people in a children’s centre on Thursday was a former police officer.
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.
Prime minister offers condolences
10:15 , Sravasti Dasgupta
Thailand’s prime minister Prayut Chan-o-cha has offered his condolences after at least 34 people including 23 children were killed in a mass shooting.
In a statement on his Facebook page, the prime minister said: “My deepest condolences to the bereaved and injured families.”
He also directed all agencies to urgently treat the wounded.
'People thought it was fireworks'
10:00 , Sravasti Dasgupta
According to the local authorities there were 30 children present at the daycare centre when the gunman came in on Thursday.
District official Jidapa Boonsom told Reuters that the man who came in around lunch time first shot four or five staff, including a teacher who was eight months pregnant.
“At first people thought it was fireworks,” she said.
Videos posted on social media showed sheets covering what appeared to be the bodies of children lying in pools of blood at the centre in the town of Uthai Sawan in the northeastern province of Nong Bua Lamphu.
The videos have not been officially authenticated.
At least 34 killed in mass shooting at Thailand daycare centre
09:51 , Sravasti Dasgupta
At least 34 people have been killed in a mass shooting at a daycare centre in northern Thailand, police say, with children and adults among the casualties.
The shooting took place around 12.50pm local time on Thursday afternoon at a centre for children in Uthaisawan Na Klang district in Nong Bua Lamphu province, police said.
At least 23 victims of the attack were children, according to the AFP news agency.
Stuti Mishra has the details:
Authorities release image of gunman
09:49 , Sravasti Dasgupta
Thailand’s Central Investigation Bureau has released an image of former policeman Panya Khamrab, who is believed to have killed at least 30 people in a nursery in the northern Thai province of Nong Bua Lam Phu.
At least 34 people were killed including 23 children, police say, after a man armed with a gun and knife stormed the nursery before later killing himself.
09:40 , Sravasti Dasgupta
Welcome to The Independent’s live blog on the mass shooting at a children’s centre in Thailand