A soldier shot multiple people in northeastern Thailand on Saturday, killing at least 21 while live-streaming part of the rampage. At least 42 other people were wounded.

Thai officials said Sunday morning the gunman had been shot dead inside the mall where he had been holed up for some 16 hours following the shooting. The shooting began on a military base before the solider moved on to the mall, officials said.

Police commandos had been searching the mall for the shooter, and police said they had secured the building from the ground floor up prior to killing the gunman. Public Health Minister Anutin Charnvirakul said there were no more bodies left inside. But he added, "we don't know whether there are any additional injuries or deaths or not."

Get Breaking News Delivered to Your Inbox

Anutin said a doctor was shot while helping an injured person. It also was not clear whether the gunman had taken hostages inside the mall or how many people might still be inside.

People are evacuated from a shopping mall by members of security forces after a shooting rampage in the city of Nakhon Ratchasima, Thailand February 08, 2020. THAI CRIME SUPPRESSION BUREAU/Reuters

The man believed to be the gunman posted updates to his Facebook page during the rampage with statements including "No one can escape death" and "Should I give up?" In a later post he wrote, "I have stopped already."

In one Facebook video -- since deleted -- the assailant, wearing an army helmet, filmed from an open jeep saying, "I'm tired... I can't pull my finger anymore" and making a trigger symbol with his hand, AFP reported.

His 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.

In a photo circulated on social media that appeared to be taken from his Facebook page, the suspect can be seen wearing a green camouflaged military helmet while a fireball and black smoke rage behind him. The Facebook page was made inaccessible after the shooting began.

Thailand security forces take cover behind an ambulance as they chase a shooter hidden in a shopping mall after a mass shooting in front of the Terminal 21, in Nakhon Ratchasima, Thailand February 9, 2020. ATHIT PERAWONGMETHA / REUTERS

Noppadol said a rescue team had successfully evacuated more than 100 people from the mall, where they had been trapped for hours. The center is a voluntary emergency aid organization that helps during accidents and disasters.

The shooter appeared to be armed with an assault rifle, based on security camera video aired on Thai Rath television. Thai Rath said the incident began at about 3:30 p.m.

A police officer contacted by phone in the city of Nakhon Ratchasima said the soldier initially shot dead another soldier and a woman and wounded a third person, apparently over a land dispute. Nakhon Ratchasima is also known as Korat.

City and neighborhood police officers, who asked not to be identified because they were not authorized to release information, said the man took a gun from his base and drove to the Terminal 21 Korat mall, shooting along the way. Several Thai media reported that he traveled in a military vehicle.

A person runs away from a shopping mall during a Thai soldier's shooting rampage in the city of Nakhon Ratchasima, Thailand February 8, 2020 in this still image obtained from social media video. NATTAYA NGANIEM/Reuters

Defense Ministry spokesman Lt. Gen. Kongcheep Tantrawanich identified the suspect as Sgt. Jakrapanth Thomma. He said police and military units had locked down the mall and the surrounding area.

Video taken outside the mall and shared on social media showed people taking cover in a parking lot as gunshots were fired.

The mall was shut down and the street outside was closed while the authorities tried to find the gunman and rescue shoppers inside.

In the initial stages, people were unsure what was happening.

Nattaya Nganiem, who shot a video from outside the mall in which gunshots were heard, recounted what she experienced.

"We just left the mall after we had our meal. While we were in our car on the opposite side, we heard a loud sound and then we could see people starting to run out. First I saw a woman run out from the mall hysterically. Then a motorcycle rider in front of her just ran and left his motorcycle there.

"I thought, what's happening? Then we heard several gunshots. The motorcycle guy probably had seen the gunman from where he was. ... We couldn't see the gunman but we could hear the sound of the gun. It was terrifying. We were just inside having dinner and my child was getting unusually restless, that's why we left, otherwise, we would have been stuck inside there. I can't believe this is happening in my hometown. I mean, this shopping mall, we go there almost every other day. "

Once she got home and learned what had happened, she fainted, she said.

Nakhon Ratchasima is about 250 kilometers (155 miles) northeast of the Thai capital, Bangkok. It is a hub for Thailand's relatively poorer and rural northeastern region.

Terminal 21 Korat is part of a small chain of Thai shopping centers run by Bangkok-based property developer LH Mall & Hotel Co. The malls feature floors modeled after major cities around the world.

The size of the mall could pose a challenge for security forces as they try to capture the gunman. It consists of seven main retail floors, including one below ground level, and scores of shops and restaurants. It also houses a movie theater on the top floor.

Many malls in Thailand, including Terminal 21's namesake in Bangkok, have metal detectors and security cameras at entrances manned by uniformed but unarmed security guards. Checks on those entering are often cursory at best.

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.