A clerk at the Royal Thai Army War College shoots three other soldiers and tried to flee the scene but ended up surrendering himself.
A Thai soldier has killed two people and wounded one other in a shooting at a military facility in Bangkok, police and army officials said.
Sergeant Major Yongyuth Mungkornkim, a clerk at the Royal Thai Army War College, shot three other soldiers around 8:45am (0145 GMT), the military said in a statement on Wednesday.
The 59-year-old tried to flee the scene but surrendered himself, deputy national police spokesperson Kissana Phathanacharoen told reporters.
"The army would like to offer condolences to the families of the deceased soldiers and the wounded. This incident was a loss for both the families and organisation. It is something that wasn't expected to happen," deputy army spokesperson Senior Colonel Sirichan Nga-thong said in a statement.
"The cause and motivation for the incident is under investigation."
In the aftermath of the shooting, police officers and soldiers guarded the gates of the facility, part of a large complex of military buildings in the north of the capital.
The military statement named the victims as Sergeant Major Nopparat Inthasunthorn and Sergeant Major Prakarn Sinsong.
The third soldier, Sergeant Major Yongyuth Panyanuwat, was taken to hospital for treatment, the statement said.
Police are investigating the shooting, spokesperson Kissana said, with initial reports suggesting the weapon used was a 9mm pistol.
Rising shooting cases
While Thailand has high rates of gun ownership, mass shootings are extremely rare.
But in the past year, there have been at least two other cases of shooting murders by serving soldiers, according to the Bangkok Post.
And in 2020, in one of the kingdom's deadliest incidents in recent years, a soldier gunned down 29 people in a 17-hour rampage and wounded scores more before he was shot dead by commandos.
That mass shooting, which shocked Thailand, was linked to a debt dispute between gunman Sergeant-Major Jakrapanth Thomma and a senior officer, and the military top brass were at pains to portray the killer as a rogue soldier.
The military has powerful influence in many aspects of life in Thailand from politics to business, and has intervened to seize power numerous times over the decades, most recently in 2014.