NAKHON RATCHASIMA, Thailand (Reuters) - A Thai soldier shot dead at least 20 people Saturday, posting messages on Facebook as he went on the rampage in a northeastern city where he was still holed up in a mall well over 12 hours after he first struck, authorities said.

Thai security forces stormed the Terminal 21 mall in the city of Nakhon Ratchasima and helped hundreds of people to escape. Looking dazed and exhausted, shoppers and storeworkers came out in small groups into the early hours of Sunday as police and soldiers worked through the mall floor by floor.

“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 after she emerged.

Several bursts of automatic gunfire could be heard from inside the mall just after 2.40 a.m. (1940 GMT) and Reuters photographer Athit Perawongmetha saw two wounded members of the security forces being brought out.

The suspected shooter was identified by police as 32-year-old Jakrapanth Thomma. During the attack he posted “Death is inevitable for everyone” on his Facebook page and later asked “Should I give up?”

The attack began at around 3 p.m. local time, when the suspect opened fire at a house. He then moved to an army base, before heading to the shopping mall in Nakhon Ratchasima, which is about 250 km (155 miles) from the capital Bangkok, police said.

Local media showed footage of the soldier getting out of a car in front of the mall and firing off a series of shots as people fled for cover.

“We don’t know why he did this. It appears he went mad,” Defence Ministry spokesman Kongcheep Tantrawanit told Reuters.

One video from a bystander showed a man slumped at the wheel of a car in a pool of blood. It was unclear if he was among the dead. Another video showed at least four people who had clearly been shot and showed no sign of movement.

Slideshow ( 11 images )

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.

Kongcheep said at least 20 people had been killed and it was not clear whether the gunman had taken hostages in the mall.

“It’s not known how many are still inside,” he said.

The health ministry said 31 people had been wounded and 10 were in a critical condition.

FACEBOOK POSTS

Thai media said the suspected shooter had worked at an army base close to Nakhon Ratchasima. Before the attack, Jakrapanth had posted on his Facebook account that he was out for vengeance -- but he did not say for what.

Facebook said it had removed the suspect’s account.

“Our hearts go out to the victims, their families and the community affected by this tragedy in Thailand. 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.

Slideshow ( 11 images )

Thai media said the suspect’s mother was being taken to the mall to try to persuade him to give up. Video showed her in tears saying “why did he do it?” as she got in a police vehicle.

Major shootings are rare in the Southeast Asian country other than in the far south, where a decades-old insurgency persists.

The shooter first went to a house in the city and shot two people dead before going to the army base, where he took a gun from the weapons store and fired at people, police said.

In a post on Facebook, Public Health Minister Anutin Charnvirakul asked for blood donations at four hospitals in the area.

Nakhon Ratchasima is one of the biggest cities in northeastern Thailand, an island of relative prosperity in a rice growing area that is one of the poorest parts of the country of 69 million people.

The Terminal 21 mall stands out in the city with its observation tower and its gleaming displays and brightly flashing advertising panels for well-known brands.