Deputy prime minister Dr Wan Azizah Wan Ismail expressed her deepest condolences to the families of the victims of the shooting rampage in the Thai city of Nakhon Ratchasima which resulted in 21 deaths and injured dozens more.

"The world has no place for people who commit heinous crimes like this and the social media cannot be used as a tool by such criminals," she told reporters at the Chinese New Year open house at Quill City Mall organised jointly by the Islamic Development Department (Jakim) and Malaysian Muslim Chinese Association (Macma).

"My deepest condolences go out to the families and loved ones of those who perished. I pray for them and those injured to have the strength to endure this test. I also pray for the speedy recovery of those injured," said Wan Azizah.

"The people of Malaysia stand with the people of Thailand during this painful period," she said.

Earlier, Reuters reported that Thai security forces killed soldier Jakrapanth Thomma after he carried out the shooting rampage.

The shooting spree began on Saturday afternoon when Jakrapanth opened fire at a house before moving to an army base and then the shopping mall in Nakhon Ratchasima, which is about 250km from the capital Bangkok, police said.

During the attack, he posted “Death is inevitable for everyone” on his Facebook page and later asked, “Should I give up?”