Gunfire volleys rang out early Sunday hours after Thai security services stormed a mall where a soldier who killed at least 20 people was believed to still be holed up.
Scores of terrified shoppers had earlier fled the Terminal 21 shopping centre escaping a bloody rampage that the gunman relayed via Facebook posts.
But it was unclear how many people remained inside the mall in the city of Nakhon Ratchasima - also known as Korat - after armed police said they had "taken control" of the ground floor of the complex late Saturday.
Authorities gave no firm details on the movements of the attacker - a junior army officer identified as Sergeant-Major Jakrapanth Thomma - but radio from emergency services at the scene said the gunmen may be in the basement of the multi-level mall.
Automatic weapons rang out just before dawn as ambulances prepared to evacuate the wounded in an attack whose motives remain unclear, seeding fear among the rescuers and media massed near the mall.
At least 10 people were in critical condition in hospital, according to the Thai Health Minister, raising fears the toll will rise.
As shoppers fled late Saturday, police from the Crime Suppression Division urged evacuees to "raise their hands" and identify themselves on the ground floor amid fears the gunmen could hide among the desperate crowds.
Earlier Jakrapanth relayed his shooting spree through Facebook posts which charted the attack from army barracks in the city to the mall, where an unknown number of shoppers remained trapped.
Hospitals across the country braced for a grim night ahead as residents flooded the hospitals to give blood and search for relatives.
"There are about 20 dead," said defence ministry spokesman Kongcheep Tantravanich.
"Police, military commandos and sharp shooters are surrounding Terminal 21," he said.
A volunteer rescue worker recounted a bloody scene of horror after his team carried four corpses to the hospital.
"I've never seen anything like this," Peerapong Chatadee told AFP.
"I just feel so sad. He is a solider he should not have fired at unarmed people."
The Thai Health Minister told reporters around 10 people were already in hospital in a "critical condition."
The bloodshed began Saturday afternoon when Jakrapanth shot three people -- among them at least one soldier -- at a senior officer's house and then at nearby army barracks.
"He stole an army vehicle and drove into the town centre," police Lieutenant-Colonel Mongkol Kuptasiri.
There the gunman used weapons stolen from the military arsenal to bring carnage to a town centre, walking into the Terminal 21 mall.
He "used a machine gun and shot innocent victims resulting in many injured and dead," police spokesman Krissana Pattanacharoen said.
Jakrapanth's motive remains unclear.
But throughout the day he posted images of himself and wrote several posts on his Facebook page as the attack unfolded, including "should I surrender?" and "no one can escape death".
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.
There were also photos of a man in a ski mask holding up a pistol.
A Facebook spokesperson said "we have removed the gunman's accounts from our services and will work around the clock to remove any violating content related to this attack as soon as we become aware of it".
Army in place
A witness who was inside the mall before the attack told AFP that the Terminal 21 shopping centre was busy with shoppers on a long weekend.
"There were loads of people at the mall today," a 32-year-old from the city said, requesting anonymity.
"I was pretty shocked when I found out because I just left the mall not long before."
Street lights below the shopping centre were switched off as army and police units sealed off the mall.
The city is home to one of Thailand's largest barracks in a country where the military is enmeshed in politics and society.
Thailand has one of the highest rates of gun ownership in the world.
Several shootings at courthouses late last year renewed concern about gun violence in the southeast Asian country.
In another high-profile case, a two-year-old boy was among three people killed when a masked gunman robbed a jewelery shop last month.
Late last year two lawyers were shot dead by a clerk at a court in the east of the country during a hearing over a land dispute.