Police said 31 people were confirmed killed by a former policeman who burst into a childcare centre in Na Klang district of Nong Bua Lamphu on Thursday.
Many of the victims were reported to be children.
The childcare centre is operated by the Uthai Sawan tambon administration organisation.
The man, who was identified as former Pol Cpl Panya Khamrab, was reportedly armed with a gun and a knife.
He forced his way into the centre and opened fire at the people inside.
Na Klang police station reported that the gunman was on the run.
Thai media reports said later that the gunman had committed suicide.