Jakraphanth Thomma on Saturday killed his commanding officer before stealing weapons from a military camp.
The suspect continued his attack in a shopping centre in Nakhon Ratchasima, also known as Korat,
He posted material to social media, but his motives for his actions remain unclear.
Public Health Minister Anutin Charnvirakul posted on his Facebook page on Sunday morning, congratulating the security forces for their actions in the northeastern Thai town.
"Thank you police and army for ending the situation. Shooter shot dead!!!"