Kansas factory mass shooting
Crime Scene investigators examine the scene of the investigation around an SUV where two suspects were shot by police following a mass shooting in Wednesday's attack in San Bernardino, California December 4, 2015 Reuters

At least three people were killed and 14 were injured as a gunman opened fire at a lawn mower factory in Kansas, United States.

The gunman, who worked at the manufacturing plant in central Kansas, was killed by the police in an encounter that followed.

The attacker opened fire at random, but many of his victims were coworkers, Harvey County Sheriff T. Walton said, Reuters reported.

The gunman was an employee at Excel Industries, located in a tight-knit community north of Wichita, Kansas.

"This is a horrible situation my friends, just terrible... There were some things that triggered this particular individual," Walton said.

He said the number of victims could rise to as high as seven. At least five of the injured were in critical condition.

The gunman was identified by local media as Cedric Ford, a painter at the factory. Witnesses said he first gunned down a woman at the parking lot and then got on to the assembly line where he shot at more people.

"We want to know what triggered this. We need to know the history of the shooter, and then we have to try to heal," the sheriff said.

According to local media reports, the gunman had an extensive criminal record. He was armed with a .223-caliber assault-style rifle and a pistol. He opened fire even as over 100 employees were beginning the day's second shift, Reuters said.