By Agence France-Presse
Police in the canton of St. Gallen said the 17-year-old Latvian national carried out the attack at the post office in the northeast town of Flums.
Several people were wounded in the initial attack before the assailant "escaped with a stolen car", police spokesman Krusi Hanspeter said in a statement.
The attacker later injured another person at a gas station where he was shot by police and apprehended, Hanspeter said.
"At this stage, there is no evidence of a link to terrorism", he added, noting that police were continuing to gather information about the assailant.
Police said the severity of the injuries suffered by the victims was not immediately clear.
According to the Blick news site, police later raided a house in the area as part of the investigation.