More than 30 people, mostly children, were killed when a gunman opened fire in a childcare centre in north-eastern Thailand on Thursday, authorities said.

Police Major General Achayon Kraithong said the shooting happened in the town of Nongbua Lamphu early in the afternoon.

He said the attacker killed 30 people before taking his own life. He had no more details.

Thailand Childcare Center Shooting
A mugshot released by the Thailand Criminal Investigations Bureau of the suspect in the attack at a childcare centre in Nongbua Lamphu (Thailand CIB/AP)

A spokesman for a regional public affairs office said 26 deaths have been confirmed so far – 23 children, two teachers and one police officer.

According to Thai media reports, the gunman also used knives in the attack and then fled the building.

Several media outlets identified the assailant as a former police lieutenant colonel from the region but there was no immediate official confirmation.

The Daily News newspaper reported that, after fleeing the scene of the attack, the assailant returned to his home and killed himself along with his wife and child.