A soldier who went on a shooting rampage in northeastern Thailand, killling at least 21 people, was shot dead by security services on Sunday morning after he holed himself up in a shopping centre.
Police and military sources told Reuters they had killed 32-year-old Jakrapanth Thomma a few hours after a failed raid on the Terminal 21 mall in Nakhon Ratchasima left one member of the security forces dead and two injured, reports Aljazeera.
“The police have killed the perpetrator and rescued eight hostages. Some were wounded," said one of the security sources who declined to be named because they were not authorised to speak to the media.
The death was confirmed by the Health Minister.
The mass shooting began at around 3pm (08:00 GMT) on Saturday when Jakrapanth opened fire in a house before moving to an army camp and then to the mall, posting messages on Facebook as he went.
Police closed off streets around the mall and kept journalists behind a security cordon, fearing the gunman had taken hostages.
Dozens of terrified shoppers were evacuated from the centre as armed police said they had "taken control" of the ground floor of the complex.
At least 31 people were wounded.
The gunman wrote on his Facebook page earlier in the day that "Death is inevitable for everyone". The suspect also posted a picture of what appeared to be his hand holding a gun.
At one point after the shooting had begun, he wrote online, "Should I give up?" before his account became inaccessible.
Thai media said the suspected shooter had worked at an army base close to Nakhon Ratchasima, which is about 250km (155 miles) from the capital Bangkok.
Before the attack, Jakrapanth had posted on his Facebook account that he was out for vengeance - but he did not say for what.
"We don't know why he did this. It appears he went mad," said Ministry of Defence spokesman Kongcheep Tantrawanit.
Al Jazeera's Wayne Hay, reporting from Bangkok, said that police had suspected Jakrapanth took hostages and that gunshots were heard from the building late at night and into the early hours of Sunday.
Prime Minister Prayuth Chan-ocha expressed condolences to the families of those killed, a government spokeswoman said.
Amateur footage
Local media earlier showed footage of the soldier getting out of a car in front of the shopping centre and firing a series of shots.
Footage circulating online showed panicked scenes, with people fleeing and what appeared to be the sound of automatic gunfire filling the air.
A woman interviewed by Thailand's Channel One television said she had heard gunshots when she was at the shopping centre and hid in a clothing store with other people before escaping.
Thailand has one of the highest rates of gun ownership in the world but mass shootings by soldiers targeting civilians are rare.
Several shootings at courthouses late last year also renewed concern about gun violence in the country.
In one high-profile case, two lawyers were shot dead by a clerk at a court in eastern Thailand during a hearing over a land dispute.