A gunman who used a firearm stolen from a ‌police officer to wound a teacher ​and a girl ‌at a school in southern Thailand's ‌Hat Yai ⁠district ‌Wednesday has been detained, ‌authorities said.The 17-year-old suspect entered Patongprathankiriwat School in ⁠Songkhla Province's Hat Yai earlier in the day, appearing agitated, the provincial government said in a statement.The suspect has a sister at the school, police commander Teerasak Chaiyotha said, but a motive has ​yet to be determined.A female teacher was critically injured and had undergone surgery and was now in ‌an intensive care ⁠unit, while ​a teen girl was shot in the ​waist and was now in stable condition, he added.In a photograph shared by police, the suspect, barefoot and wearing shorts and a T-shirt, is shown pinned to the ground by armed officers.He had earlier attacked a police officer and stolen his firearm, provincial governor Ratthasart ‌Chidchoo said, adding that ‌the suspect had ⁠a history of substance abuse and was discharged ⁠from a ⁠psychiatric hospital in December. In a video obtained by Reuters, armed police officers storm the three-storey school building as gunfire rings out.Another video shows students running down staircases while police - some ​wearing helmets, black bulletproof vests, and carrying rifles - shout: "Go home kids, it's safe."Gun violence and ownership are not uncommon in Thailand. In 2002, a former police officer killed 36 people, including 22 children, in a gun-and-knife attack at a nursery in the country's east.