The shooting occurred shortly after 9 a.m. at the premises of Kronospan, a company in the small town of Menznau, west of Lucerne.
"There were three dead and seven injured, some of them seriously injured," prosecutors' spokesman Simon Kopp told Swiss newspaper Blick. He said the assailant was among the dead.
The local Neue Luzerner Zeitung newspaper cited a witness as saying that the shooter opened fire in the company canteen. It was not immediately clear who the shooter was, what the motive might have been or whether the assailant worked for the company.
According to the local town council, Kronospan has some 450 employees.
Gun ownership is widespread in Switzerland, thanks to liberal regulation -- a 2012 referendum to tighten controls failed -- and a long-standing tradition for men to keep their military rifles after completing compulsory military service.
An estimated 2.3 million firearms are owned by the country's 8 million people.
But gun crime is relatively rare, with just 24 gun killings in 2009, which works out to a rate of about 0.3 per 100,000 inhabitants. The U.S. rate that year was about 11 times higher.
Still, there have been several high-profile incidents over the years, including the killing of 14 people at a city council meeting in Zug, not far from Lucerne, in 2001.
Last month a 33-year-old man killed three women and wounded two men in a southern Swiss village.