The shooter is believed to have known his three victims, women aged 32, 54 and 79. He also shot and injured two men, aged 33 and 63, police confirmed at a press conference on Thursday morning.
Armed with a 1960s-era Swiss army carbine and a hunting rifle, the 33-year-old fired around 20 shots from his apartment before continuing his shooting spree on a street in Daillon, a small village in the canton of Valais.
Police said the man had his military weapons confiscated in 2005, when he was admitted to a psychiatric clinic. It is not known how he gained possession of the weapons used in Wednesday evening’s attack.
Cantonal police spokesman Jean-Marie Bornet told AFP that police had returned fire after coming under threat from the man, named by local media only as Cedric.
Of the two injured, one was in critical condition, police said, while the second was recovering after being wounded in the shoulder.
Le Matin newspaper said the 63-year-old who was shot in the shoulder, a former policeman, was the suspect's uncle and his neighbour and was involved in a family dispute with the gunman.
The alleged shooter lived in the house his parents had given him when they divorced.
He was wounded during an exchange of gunfire while being apprehended by police and was also taken to a hospital, where he was in intensive care.
"There was an exchange of gunfire because he was threatening police officers. He was hit and wounded," Bornet said, adding that no police officers were injured.
"There is bewilderment and shock in Valais. This is a man who lived in Daillon and opened fire on his neighbours," Bornet told RSR Swiss radio.
His motives for the shooting were not known, but officials said he was a resident of the village and had known his victims.
"Three victims died at the scene. Two other people were wounded and hospitalized," said police in the canton of Valais, which borders Italy and France.
Forensic investigators were at work Thursday in the picturesque village of 400 residents, which is perched at an altitude of 1,000 metres and surrounded by vineyards.
Police said in an earlier statement they had responded after being called about the shooting and told that "several injured people are lying on the ground".
Police "immediately intervened and neutralized the suspect," the statement said.
Swiss media quoted local residents as saying the gunman had been drinking heavily before the shooting.
Resident Marie-Paule Udry told news website 20Minutes.ch the man had been in a local restaurant prior to the shooting, adding: "He had drunk a lot."
Gun ownership is widespread in Switzerland, where the law allows any citizen aged over 18 to possess arms under certain conditions.
The defence ministry says there are some two million weapons in private hands among Switzerland's about eight million inhabitants.