Harvey County Sheriff T Walton said the dead included the gunman, an employee at Excel Industries, located in a tight-knit community north of Wichita.
Walton said the first officer to arrive at the scene of the shooting took place late last night shot the gunman, saving "many, many lives."
"This is a horrible situation, just terrible," Walton said, adding that his department received a call from the White House after the incident.
The sheriff initially had said that up to seven people had been killed and up to 30 wounded but later revised the toll downwards.
Also Read
The carnage was the latest in a string of mass shootings in the United States, where such attacks have become commonplace.
Walton said the gunman, who he declined to identify, first fired at two motorists from his car, stealing one of the victims' pickup truck before heading to the factory.
He shot a woman in the parking lot with an assault rifle and then entered the facility unleashing a volley of bullets as people ran for their lives screaming "run, fire, fire," according to one witness.
Ford recently moved to the area from Miami, and had an extensive criminal record, including a history of prowling, loitering and illegal weapons possession, media reports said.
Walton said police surrounded the gunman's home after the shooting but his male roommate refused to allow them in, resulting in a standoff that continued unresolved late last night.
"We will make entry," he said.
The victims were transported to area hospitals, where five were listed in critical condition, as family members rushed to the factory for news of their loved ones.
"I hear about these shootings at theatres and things, and it's just a mess... It's horrible," an eyewitness said, referring to mass shootings that have become a fact of life across the country.
"This guy had this planned."
Several employees at the plant told local media they believed that the shooter had emotional and mental problems.
"Someone said this guy got fired, got upset and just came back and shot people," Marty Pierce, an eyewitness who works at the plant, told KAKE television.
The Hesston shooting was the latest in a string of mass killings in the United States that include Saturday's rampage by an Uber driver that left six people dead in Michigan, the December terror attack in San Bernardino, California that left 14 people dead, and the December 2012 Sandy Hook school massacre that killed 26, including 20 children.