A man wearing a police vest opened fire during a session of Canton Zug's regional assembly on Thursday, leaving 15 people dead - including the gunman. Another fifteen people were injured.
Three members of government, and 11 members of parliament, were among the dead. Police identified the gunman as Friedrich Leibacher, 57, of canton Zurich, who, they said, had been involved in a legal conflict with local authorities.
The attacker entered the parliament building at 10.30am on Thursday and opened fire with an assault rifle in the assembly room. Authorities say he then briefly left, came back and threw a hand grenade into the room, where 80 local representatives were gathered for the cantonal parliament's monthly session.
"The man strode through the whole floor, shooting at people," said a Swiss Telegraphic Agency reporter Dominik Hertach. People threw themselves to the floor when the shooting began, and there were loud screams from the injured, he said.
The blast of the hand grenade filled the room with smoke, ripped off doors and shattered windows.
"It lasted about three minutes, almost like an execution," said Hanspeter Hausheer, a member of the assembly and a banker at UBS Warburg.
The assembly room was covered with blood after the shooting and several people lay wounded in the chambers.
Police, ambulances and the fire brigade arrived at the scene shortly after the attack.
The three government members who died were identified as Monika Hutter-Häfliger, health director for canton Zug; construction director Jean-Paul Flachsmann, and the head of the interior department, Peter Bossard.
At least fifteen politicians and journalists suffered injuries. One person is in a critical condition.
Row over transport
At a news conference, police officials said Leibacher's grievances dated back to a row with a bus driver two years ago. He subsequently insulted public transport workers, leading the transport department to file a complaint against him.
Leibacher responded with counter-complaints relating to transport and justice department figures. He filed suits at every level of the Swiss legal system, including the Supreme Court. All his cases were dismissed, and he was recently told of the latest rejection.
"He did this purely out of revenge and fury," said local investigator Kurt Blöchinger.
Robert Bisig, director of the economics department and one of only two officials not harmed, said Leibacher had bombarded them with letters and pamphlets demanding his rights.
All his accusations were dismissed because "they were so far from reality," said Bisig.
Police found a letter left behind by the gunman which spoke of "a day of rage against the Zug mafia." In it, Leibacher accused authorities of being a "band of criminals," "pirates" and "alcoholics."
They said the assailant used a Swiss-made 5.6mm SIG "Sturmgewehr 90", an assault rifle used by the Swiss army. He also carried a pistol with several magazines of ammunition.
Police have also seized a car with Swiss licence plates which was found near the parliament building, which contained a number of weapons.
Authorities say it is probable that Leibacher had served in the country's militia army when he was younger.
Expressions of shock
Swiss President Moritz Leuenberger headed to Zug upon news of the attack, and laid down flowers in front of Zug's Parliament building.
"This was not just an attack on people, but it was also an attack on our democratic institutions," said Leuenberger. "We live in a country where even the highest ranking politicians can move about freely."
"This is an hour of shock and incomprehension. But we have to stick together if we want to uphold the values of a free democracy, ."
Peter Hess, speaker of the national House of Representatives and a Zug native, called for a minute's silence. "I am shocked this happened in Zug," Hess said. "I cannot remember an attack against parliamentarians in a parliament building in Switzerland ever happening during a session."
Hess and Leuenberger were among those who attended a religious service in Zug's church on Thursday evening.
Leuenberger has ordered all state flags to fly at half-staff for the next three days. Monday has been declared a national day of mourning.
The attack in Zug is Switzerland's worst mass killing on record. The last shooting by a gunman occurred in 1992, when Erminio Criscione ran through three southern Swiss villages ringing bells and shot six people as they opened the door.
In May 1991, a businessman killed five members of his family before shooting himself in an alpine valley.
swissinfo with agencies