UTHAI SAWAN, THAILAND -- Relatives wailed and collapsed in grief over the small coffins of children Friday after a fired police officer stormed a rural Thai day care center at naptime and massacred dozens of people.

Thailand's deadliest mass killing left virtually no one untouched in the small community nestled among rice paddies in one of the nation's poorest regions. Grief also gripped the rest of the country, where flags were lowered to half-staff and schoolchildren said prayers to honor the dead.

At least 24 of the 36 people killed in Thursday's grisly gun and knife attack were children, mostly preschoolers.

"I cried until I had no more tears coming out of my eyes. They are running through my heart," said Seksan Sriraj, 28, whose pregnant wife was due to give birth this month and who worked at the Young Children's Development Center in Uthai Sawan.

"My wife and my child have gone to a peaceful place. I am alive and will have to live. If I can't go on, my wife and my child will be worried about me, and they won't be reborn in the next life," he said.

A stream of people, including Prime Minister Prayuth Chan-ocha, other government representatives and relatives themselves, left flowers at the day care center on Friday. By afternoon, bouquets of white roses and carnations lined the wall outside, along with five tiny juice boxes, bags of corn chips and a stuffed animal.

Later, relatives received the bodies at the local Buddhist temple. As the small, white coffins were opened, some screamed, while others fainted and were revived with smelling salts. For a time, the grounds outside the temple were crowded with people overcome by grief.

"It was just too much. I can't accept this," said Oy Yodkhao, 51, sitting on a bamboo mat in the oppressive heat as relatives gave her water and gently mopped her brow.

Her 4-year-old grandson Tawatchai Sriphu was killed, and she said she worried for the child's siblings. The family of rice farmers is close, with three generations living under one roof.

Som-Mai Pitfai collapsed when she saw the body of her 3-year-old niece.

"When I looked, I saw she had been slashed in the face with a knife," the 58-year-old said, holding back tears.

King Maha Vajiralongkorn and Queen Suthida visited hospitals, where seven of the 10 people wounded are being treated, and met with family members of victims in what he said was a bid to boost morale.

"It is a tragedy that this evil thing has happened," the monarch told reporters during a rare public appearance. "But right now, we have to think of what we can do to improve things to the best of our ability."

Police identified the attacker as Panya Kamrap, 34, a former police sergeant fired earlier this year because of a drug charge involving methamphetamine. He had been due to appear in court Friday. An employee told a Thai TV station that Panya's son had attended the day care but hadn't been there for about a month.

Panya took his own life after killing his wife and child at home. A motive for the killings remains unknown, although money and marital problems appeared to be involved.

In an interview with Amarin TV, Satita Boonsom, who worked at the day care center, said staff locked the glass front door to the building after seeing the assailant shoot a child and his father out front. But the gunman shot and kicked his way through it.

The children, mainly preschoolers, had been taking an afternoon nap, and photos taken by first responders showed their tiny bodies still lying on blankets. In some images, slashes to the victims' faces and gunshots to their heads could be seen.

Satita said she and three other teachers climbed the center's fence to escape and call police and seek help. By the time she returned, the children were dead. She said one child who was covered by a blanket survived the attack, apparently because the assailant assumed he was dead.

She said the center usually has around 70 to 80 children, but there were fewer at the time of the attack because the semester had ended for older children and rain prevented a school bus from operating.

"They wouldn't have survived," she said.

Satita added that the attacker's son hadn't been to the day care center recently because he was sick.

One of the youngest survivors is a 3-year-old boy who was riding a tricycle close to his mother and grandmother when the assailant began slashing them with the knife. The mother died from her wounds, and the boy and grandmother were being treated at hospitals, according to local media.

Mass shootings are rare but not unheard of in Thailand, which has one of the highest civilian gun ownership rates in Asia, with 15.1 weapons per 100 people compared to only 0.3 in Singapore and 0.25 in Japan. That's still far lower than the U.S. rate of 120.5 per 100 people, according to a 2017 survey by Australia's GunPolicy.org nonprofit organization.

Support and condolences poured in from around the world. "All Australians send their love and condolences," Prime Minister Anthony Albanese tweeted. U.S. Secretary of State Antony Blinken called the violence "senseless and heartbreaking."

Pope Francis offered prayers for all those affected by such "unspeakable violence."

"I'm profoundly saddened by the heinous shooting at a childcare centre in Thailand," U.N. Secretary-General Antonio Guterres tweeted.

Thailand's previous worst mass killing 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.

Nearly 60 others were wounded in that attack. Its death toll surpassed that of the previously worst attack on civilians, a 2015 bombing at a shrine in Bangkok that killed 20 people. It was allegedly carried out by human traffickers in retaliation for a crackdown on their network.

Last month, a clerk shot co-workers at Thailand's Army War College in Bangkok, killing two and wounding another before he was arrested.

------

Associated Press writers Chalida Ekvitthayavechnukul, Elaine Kurtenbach and Grant Peck in Bangkok and Kim Tong-hyung in Seoul, South Korea, contributed to this report.