* Hundreds rescued from shopping centre in hours-long siege
* Soldier first shot commanding officer, stole Humvee and guns
* Facebook cut off soldier's account after he posted during attack
A soldier angry over a property deal gone sour killed at least 29 people and wounded 57 in a rampage that spanned four locations in and around the northeastern Thai city of Nakhon Ratchasima before he was shot dead early Sunday.
Most of the victims were at the city's Terminal 21 shopping centre, where the shooter held out against an overnight siege with an assault rifle and ammunition stolen from his army base.
Police named him as 32-year-old soldier Jakrapanth Thomma. He initially posted written messages on Facebook during the attack before his account was shut down by the company.
"It was a personal conflict...over a house deal," Prime Minister Prayuth Chan-ocha told reporters on Sunday from Nakhon Ratchasima after travelling there to meet wounded survivors.
Prayuth added that the conflict was with a relative of the soldier's commanding officer.
Thailand's worst mass shooting prompted soul searching in the southeast Asian country of 69 million, where the army has long styled itself as the protector of the nation and dominated politics for decades either overtly or from behind the scenes.
Prayuth, a former military ruler, came in for criticism over his handling of the incident after he waved and smiled during a visit to the scene and made a heart gesture with his fingers. The hashtag #RIPPrayuth was trending on Thai social media.
"If you have a heart like kind Thais, you should respect relatives of the deceased with a calm and mournful manner," commented Jirayu Houngsub, an opposition member of parliament.
At a morgue in Nakhon Ratchasima, the family of 13-year-old Ratchanon Karnchanamethee sobbed as they identified his body.
"He's my only son. He hasn't even had dinner," said his father, Natthawut Karnchanamethee. "I allowed him to do anything he wanted to. I never set expectations for him. I only wanted him to be a good person."
Led by police and soldiers, hundreds of shoppers fled the mall during the 12-hour standoff. Crouching low, they escaped in small groups, dazed and exhausted. At one point, armed forces emerged at a run carrying small children.
"It was frightening because I could hear the occasional gunshot...we waited a long time for the police to come and help us, many hours," said Suvanarat Jirattanasakul, 27, her voice trembling.
Another survivor told local Amarin TV that the shooter was "aiming for the heads" and said his colleague died on the scene.
"He was shooting everywhere and his shots were very precise," said the man, identified as "Diaw".
The province's governor, Wichien Chantaranochai, on Sunday night said a total of 29 people had been killed and 57 were wounded.
Also known by the historical name Korat, Nakhon Ratchasima has a population of about 250,000. It is close to a national park popular for its wild elephants but the relatively poor northeastern region is one of the less visited areas for Thailand's tens of millions of tourists.
CCTV footage from inside the mall posted on social media showed the gunman dressed in black and wearing a mask, his gun slung over his shoulder with no sign of other people around.
According to local media, Jakrapanth worked at an army base close to Nakhon Ratchasima, which is about 250 km (155 miles) from the capital Bangkok.
He was a sharp shooter and took many special courses on carrying out attacks, including planning ambushes, army sources said. Thai media reported he often posted photos of weapons on social media.
The killings began at around 3 p.m. (0800 GMT) on Saturday when the soldier opened fire in a house before moving to an army camp and then driving to the mall in a stolen Humvee.
The soldier's commanding officer was one of the people reported killed before the soldier moved on to the shopping mall and began shooting.
At some point during the day, the soldier raided the army camp's weapons storage to arm himself, said Lt. General Thanya Kiatsarn, Commander of the Second Area Command.
"He attacked the guard to the weapon arsenal, who later died, and he stole an official jeep and an HK33 gun and an amount of ammunition to do what he did," Thanya said.
Hours before he began shooting on Saturday, Jakrapanth had posted on his Facebook account denouncing greedy people.
"Rich from cheating. Taking advantage of other people. Do they think they can spend the money in hell?" read one post in Thai.
He later posted written updates during the attack.
"Death is inevitable for everyone," he wrote. Later, he complained about his fingers cramping and asked "Should I give up?" before the account was no longer available.
Hours after the mall siege began, Facebook said it had removed the suspect's account.
"There is no place on Facebook for people who commit this kind of atrocity, nor do we allow people to praise or support this attack," a Facebook representative said in a statement.
Major shootings are rare in Thailand other than in the far south, where a decades-old insurgency persists.
Ambulances carrying the bodies of the victims arrive at a hospital in Nakhon Ratchasima, Thailand