Thai security forces have killed a soldier who shot dead at least 29 people during a brutal rampage on Saturday.
Police and military personnel stormed the Terminal 21 shopping mall in the northwestern city of Nakhon Ratchasima to face suspected gunman Sgt Jakrapanth Thomma.
Of those who died, 23 were civilians, three were police officers and three were army officers.
Officials said the soldier, who has been confirmed dead, was angry over a land deal.
His death brought an end to an hours-long stand-off at the centre, during which automatic gunfire was heard and one security officer died, with two others wounded.
Thailand’s Prime Minister Prayuth Chan-ocha gave the higher death toll on Sunday, an increase from an earlier figure of 20. Fifty-seven people are wounded.
“It is unprecedented in Thailand, and I want this to be the last time this crisis happens,” he said, after visiting the wounded at a hospital in Nakhon Ratchasima.
He said the motive for the attack appeared to be Jakraphanth’s grudge over his belief that he had been cheated in a property deal.
Public Health Minister Anutin Charnvirakul posted on his Facebook page on Sunday morning, congratulating the security forces for their actions in the north-eastern Thai town.
“Thank you police and army for ending the situation. Shooter shot dead!!!”
Hundreds of people were evacuated from the mall in small batches by police while they searched for the gunman.
“We were scared and ran to hide in toilets,” said Sumana Jeerawattanasuk, one of those rescued by police. She said seven or eight people hid in the same room as her.
“I am so glad. I was so scared of getting hurt,” she said.
Shortly before midnight, police announced they had secured the above-ground portion of the mall, but were still searching for the gunman. About 16 hours later, officials held a news conference to announce the gunman had been shot dead
Defense Ministry spokesman Kongcheep told Thai media that the first person killed was the commanding officer of the 22nd Ammunition Battalion, in which the suspect also served. He said the gunman had fired at others at his base and took guns and ammunition before fleeing in an army Humvee.
City and neighbourhood police officers said the man fired shots as he drove to the mall. Thai Rath television aired mall security camera footage showing a man with what appeared to be an assault rifle.
The man also posted updates to his Facebook page during the rampage.
“No one can escape death,” read one post. Another asked, “Should I give up?” In a later post, he wrote, “I have stopped already.”
A photo circulated on social media that appeared to be taken from the Facebook page shows a man wearing a green camouflaged military helmet while a fireball and black smoke rage behind him.
Jakrapanth’s profile picture shows him in a mask and dressed in military-style fatigues and armed with a pistol. The background image is of a handgun and bullets. The Facebook page was made inaccessible after the shooting began.
Gun violence is not unheard of in Thailand. Firearms can be obtained legally, and many Thais own guns. Mass shootings are rare, though there are occasional gun battles in the far south of the country, where authorities have for years battled a long-running separatist insurgency.