Updated at 10:46 p.m. ET
A gunman armed with an assault rifle killed at least 27 people and wounded more than 52 in a Thai city while livestreaming himself on social media Saturday, officials say.
The suspect has been identified as a junior soldier at a base near the city of Nakhon Ratchasima, which is also known as Korat and is about a 180-mile drive northeast of Bangkok.
Police say the gunman shot a superior officer and others at the base, NPR's Michael Sullivan reports. The gunman then fled the scene and resumed shooting at a nearby shopping mall.
Shortly before midnight, police announced that they had secured the seven-floor mall but gave no information about the gunman's whereabouts, The Associated Press reports. During a news conference more than 15 hours later, Security forces said the gunman had been shot dead inside of the mall where he carried out the rampage.
Earlier, security forces stormed the mall and helped hundreds escape, defense ministry spokesman Kongcheep Tantrawanit told Reuters.
"It was frightening because I could hear the occasional gunshot," Suvanarat Jirattanasakul, 27, told Reuters after she emerged from the mall, her voice trembling, "We waited a long time for the police to come and help us, many hours."
The newspaper Thai Rath reports that the incident began at about 3:30 p.m. local time, according to the AP.
Local media showed footage of the suspect exiting a car in front of a shopping mall and firing a series of shots, as people ran for cover. Gunshots could be heard on the video, the AP reports.
According to the BBC, the suspect's mother has been brought to the shopping center to try to talk him into giving himself up. Video showed her saying "Why did he do it?" in tears as she entered a police vehicle, Reuters reports.
Police have warned people to stay at home, the BBC reports.
The suspect had posted on his Facebook page earlier in the day: "Death is inevitable for everyone." He also posted a photo of what appeared to be a gun held in his hand, Reuters reports.
The Facebook page has been taken down, AP reports.
"We don't know why he did this. It appears he went mad," said Tantrawanit, according to Reuters.
Police said the soldier was angry over a land dispute, AP reports.
Prime Minister Prayuth Chan-ocha is following developments and expressed condolences to the families of victims, a spokeswoman told the BBC.
The incident comes a month after another high-profile mall shooting in the central Thai city of Lopburi. A masked man with a handgun killed three people, including a 2-year-old boy, and wounded four others as he robbed a jewelry store, the AP reports.
Firearms can be obtained legally in Thailand, but mass shootings are rare events other than in the far south, where a decades-old insurgency persists, Reuters reports.
Many malls in Thailand, including Terminal 21's namesake in Bangkok, are equipped with metal detectors and security cameras at entrances manned by unarmed security guards. Checks on those entering are often cursory at best, the AP reports.