At least seven people have been killed and 23 injured after a 14-year-old boy opened fire at a home and his school on the outskirts of Thailand's capital Bangkok.
The gunman - a student at the Debsirin School in Nonthaburi - killed his grandparents and five teachers before taking his own life, Thai Prime Minister Anutin Charnvirakul told reporters. The attacker still had "more than 30 bullets left" when he turned the gun on himself, Anutin added.
Nine of the injured people remain in a critical condition, authorities say.
The shooting - the second at a school in Thailand this year - has renewed pressure on the government for greater action on gun control.
Police were deployed to the scene during the active shooting, which began just after 10:00 local time (03:00 GMT).
National police chief police general Kittiratt Phanphet told reporters that forensic officers had found the gunman's shots were quite accurate, with several hitting vital spots on the body.
The prime minister said the attack was "well prepared" with "clear steps and clear goals".
The attacker has not been publicly named, and police haven't disclosed a motive - though the prime minister said the boy may have been stressed about his studies.
Investigations are continuing, with officers seen carrying away computer equipment and boxes from a home where police say the shooter killed his grandparents before the school rampage.
The Debsirin School, founded in Bangkok in 1885, is one of Thailand's top secondary schools with branches across the country. It counts many prominent Thai figures as its alumni, from diplomats and athletes to several prime ministers.
A female seventh grader, still in school uniform, told the BBC she was standing in front of her teacher when the woman was shot.
"She was talking to me when [the gunman] showed up and shot her," she said.
"I couldn't see anything but a [cloud] of dust."
Still in her uniform, with her mother by her side, she explained how the shooter stalked from room to room.
"I had to climb over the school fence to escape with other friends."
Her mother says the girl thought she might die. "[She said] 'I thought I'd never see you again'."
Another student told Reuters news agency that he had thought the sound of gunshots were firecrackers going off.
"There were many shots: bang bang bang. Then it went quiet. Then it started again."
Students and school staff were seen fleeing from the scene, and those waiting outside the Debsirin School looked visibly distraught.
Authorities warned people to stay away from the area and for those trapped in the building to hide and wait for rescuers.
In a post on social media, the school later shared a call for blood donations.
Other schools in the vicinity suspended classes so students could return home early.
PM Anutin expressed condolences for the victims of the school shooting. He said the tragedy "shouldn't have happened", adding "this is why the government do not allow [citizens] to possess firearms".
"I don't just feel sorry for the victims but I feel sorry that this happened. How can this happen in our country," he said.
Thailand has strict gun laws, which punishes the illegal possession of arms with up to 10 years in jail. Enforcement of these laws has been an issue - though police have made no suggestion the weapon used in this case, owned by the shooter's grandfather, was illegally obtained.
The country has one of the highest rates of civilian gun ownership in South East Asia. It is estimated that about 40% of these guns are illegal.