Security forces have shot dead a soldier who killed 26 people in a gun attack in the Thai city of Nakhon Ratchasima, Thai police say.
Jakraphanth Thomma killed his commanding officer on Saturday, before stealing guns from a military camp.
The attacker launched his attack on the streets and in a Nakhon Ratchasima shopping center, also known as Korat.
The gunman, who was sharing content on social media, was shot dead after he was cornered in the building all night.
Thailand’s Premier Prayuth Chan-Ocha on Sunday gave the higher death toll, a rise from an earlier figure of 20. Fifty-seven people suffered injuries.
“It’s unprecedented in Thailand, and I want this to be the last time this crisis happens,” he said, after visiting the wounded at a Nakhon Ratchasima hospital.
He said the motive for the attack seemed to be Jakraphanth’s grudge over his suspicion that a property deal had cheated him.
Minister of Public Health Anutin Charnvirakul posted Sunday morning on his Facebook page, congratulating the security forces on their actions in north-east Thai city.
“Thank you police and army for putting a stop to this crisis. Shooter shot dead!!!”
What happened at the shopping center?
Shortly after 03:00 local time (Saturday 20:00 GMT) gunfire was heard as security forces stormed the house, trying to dislodge the gunman.
Many people have been taken out of the center, but there has been a fear that more people are being held, hostage.
At 09:30 (02:30 GMT) on Sunday, police confirmed the gunman was shot dead but there is no further information as to how the operation was conducted so far.
Earlier reports said the 32-year-old gunman had been trying to escape via the building’s back.
The suspect’s mother was also taken to the shopping center to try to persuade him to surrender.
One of the liberated people told the BBC how she and others hid in a fourth-floor bathroom, before running to the second floor and hiding for three hours under a restaurant table, hearing at least four gunshots before seeing some soldiers and being able to get to safety.
Charlie Crowson, an English teacher who lives at Nakhon Ratchasima, told the BBC that the usually peaceful town had “bodies on the ground.”
He said one of the former students of his girlfriend was among those killed in the attack that lasted for several hours.
When did the attack unfold?
It began at about 15:30 local time on Saturday (08:30 GMT) at the Suatham Phithak military camp, where the commanding officer, named Col Anantharot Krasae by the Bangkok Post, was killed.
A 63-year-old woman, mother-in-law of Col Anantharot, and another soldier were also killed there, the Post said.
The perpetrator had stolen arms and ammunition from the camp before taking a vehicle of the Humvee type.
He then opened fire at several locations before arriving at Terminal 21 at about 18:00 local time (11:00 GMT).
Local media video seemed to show the perpetrator escaping from his car and firing shots.
CCTV footage portrayed him with a raised gun inside the shopping center.
What has the perpetrator been posting on social media?
During the attack, he wrote on his social media accounts, with one Facebook post asking if he should surrender.
He had previously posted a gun picture with three sets of bullets, along with the words “it’s time to get excited” and “no one can avoid death.”
Facebook has now taken down the link.
It said: “Our hearts go out to the victims, their families and the community impacted by this tragedy in Thailand. People who commit this kind of atrocity have no position on Facebook, nor do we encourage people to applaud or support this attack.”