On Saturday 8 February, Thai soldier Jakraphanth Thomma killed his commanding officer, stole weapons from a military base, and went on to launch a devastating attack on civilians in the city of Nakhon Ratchasima.
So far 26 people have been confirmed dead with 57 injured, but those numbers could rise.
On Sunday morning, the security forces shot Jakraphanth dead, after he had been holed up all night in a shopping centre.
Here's how it all unfolded (all times local, GMT +7 hours)
15:30: Suatham Phithak Military Camp
The attack begins. Jakraphanth, 32, kills his commanding officer, Col Anantharot Krasae, 48, and Col Anantharot's 63-year-old mother-in-law, Anong Mitchan.
Jakraphanth steals weapons - an HK33 assault rifle, BBC Thai reports - and ammunition, before fleeing the camp in a Humvee-type vehicle.
About 18:00: Terminal 21 shopping centre
Footage appears to show Jakraphanth arriving at the Terminal 21 shopping centre in Korat.
He goes on to indiscriminately shoot at people inside the mall, killing and injuring dozens of people.
He posts updates on Facebook during the attack.
19:20: Terminal 21, fourth floor
Officials confirm that Jakraphanth is on the fourth floor of the shopping centre. Reports say he is holding hostages inside.
He posts a video of himself holding a rifle on Facebook, and says: "Tired, I can barely move my fingers."
People trapped inside the shopping centre hide in bathroom cubicles and under tables, they later tell BBC Thai.
Facebook takes down the post and profile soon afterwards.
Facebook says in a statement: "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."
19:55: The first death toll
Colonel Krishna Phatthanacharoen, deputy spokesman for the Royal Thai Police, confirms that more than 10 people have died.
A number of police officers surround the shopping centre, while others enter the building to try and help people inside to escape.
A radius of 2km around the shopping centre is cordoned off.
Police officers meet Jakraphanth's mother, and bring her to the shopping centre so she can attempt to persuade him to surrender.
21:20: Death toll rises
The official death toll rises to 16.
22:05: More gunfire in Terminal 21
Another round of gunfire is heard from within the shopping centre, before calming down again.
23:09: Military assistance
A spokesman for the Ministry of Defence says that the military will assist the police in protecting the shopping centre, and helping people trapped inside to escape.
23:35: Terminal 21, ground floor
Officers confirm that they have managed to clear the ground floor of the shopping centre, as well as floors one, two and three. Images show people fleeing.
Army officials ask news outlets to stop live coverage of the attack, to avoid giving the suspect information about their operations.
23:50: Death toll rises again
Deputy Prime Minister Anutin Charnverakul confirms that the death toll has risen to 20. He says 16 people died at the scene, while another four died in hospital.
He adds that two police officers have been shot in the back and the leg, and are currently undergoing surgery.
9 February, 02:47: More gunshots
There are reports of sporadic rounds of gunfire within the building. Special Operations officers enter the building.
At the same time, about five ambulances arrive at the shopping centre to take injured people to hospital.
A member of the security forces dies in the operation.
09:00: Gunman dead
The security forces announce that they have shot dead the gunman.
Public Health Minister Anutin Charnvirakul posts on his Facebook page, thanking the police and the military officers who carried out the operation.
12:30: Prime minister visits wounded
"It is unprecedented in Thailand, and I want this to be the last time this crisis happens," said Prayuth Chan-ocha outside a hospital in Nakhon Ratchasima.
He announced a revised death toll of 26, plus the gunman, with 57 people wounded.
He said that a property deal appeared to have given Jakraphanth a sense of grievance which led to his rampage.