Police guard the front door of Excel Industries in Hesston, Kansas.
The victims were transported to area hospitals as family members rushed to the factory for news of their loved ones. One man said his 21-year-old nephew had been shot four times in the back and was taken to hospital.
Witnesses reported seeing the gunman first shoot a woman in the parking lot of the factory before entering the assembly area and opening fire.
Local media identified the gunman as Cedric Ford, who worked as a painter at the factory and had posted a picture of himself on Facebook with an assault rifle.
Harvey County Sheriff T Walton said the number of victims could possibly rise to seven. He said the gunman, an employee at Excel Industries, was among the dead.
At least four people were killed and up to 30 wounded when a gunman opened fire at a lawn mower factory in a small Kansas town, police has said.
The gunman, an employee at Excel Industries, was among the dead.