He was killed about 9am, chief of the Crime Suppression Division Jirabhob Bhuridej told AFP. The health minister and police chief confirmed the gunman’s death.
Volleys of gunfire rang out before dawn, hours after Thai security services stormed the ground floor of the Terminal 21 mall in Nakhon Ratchasima -- also known as Korat -- where the gunman held out, armed with assault weapons stolen from his barracks.
As police entered the mall, scores of stunned and terrified shoppers fled a bloody rampage that the gunman relayed via Facebook posts.
But it was unclear how many people remained inside the mall after police said they had "taken control" of the ground floor of the complex late Saturday. Reports in the Thai media estimate anywhere from 42 up to 60 people remained injured with gunshot wounds in the mall.
The latest casualty was a police officer who took part in a raid around 3 am (2000 GMT Saturday) to force the gunman out, said deputy prime minister Anutin Charnvirakul.
"He had been hit and unfortunately, he couldn’t make it," said Anutin, who is also Thailand’s health minister.
Shocked evacuees recounted how an ordinary Saturday shopping day at the busy mall descended into horror as the gunman entered.
"It was like a dream... I’m grateful I survived," Sottiyanee Unchalee, 48, told AFP, explaining she hid in the toilet of a gym inside the mall as she heard the gunfire.
"I’m so sorry for those who died... (and) the people still trapped inside."
Over 12 hours since the rampage began, authorities gave no fresh details on the movements of the attacker -- a junior army officer identified as Sergeant-Major Jakrapanth Thomma.
But speculation mounted that the gunmen may have retreated to a basement of the multi-level mall.
Automatic weapon fire rang out just before dawn as ambulances prepared to evacuate the wounded in an attack whose motives remain unclear.
So far, 31 people have been injured, with four seriously wounded, added Anutin.
As shoppers ran for the exits late Saturday, police urged evacuees to "raise their hands" and identify themselves on the ground floor over fears the gunmen could hide among the desperate crowds.
Earlier, Jakrapanth relayed his shooting spree through Facebook posts which charted the attack from the army barracks in the city to the mall, where an unknown number of shoppers remained trapped.
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 soldier, he should not have fired at unarmed people."
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 the nearby army barracks, before driving an army vehicle to the town centre.
There the gunman used weapons stolen from the military arsenal to unleash carnage in the town centre.
He "used a machine gun and shot innocent victims resulting in many injured and dead", said police spokesman Krissana Pattanacharoen.
Throughout the day, Jakrapanth posted images of himself and wrote several posts on his Facebook page as the attack unfolded.
In one Facebook video -- since deleted -- the assailant, wearing an army helmet, filmed from an open-top jeep, saying, "I’m tired... I can’t pull my finger anymore" as he made 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."
The city is home to one of the largest barracks in Thailand, a country where the military is enmeshed in politics and society.
The nation also has one of the highest rates of gun ownership in the world, and several shootings at courthouses last year renewed concern about gun violence.