LOS ANGELES: A gunman killed three people and wounded 14 others at a lawnmower factory in Kansas on Thursday before being gunned down by police in the latest mass shooting to rock the United States, according to a police official.

Harvey County Sheriff T. Walton said the gunman, an employee at Excel Industries, located in a tight-knit community north of Wichita, was among the dead.

“The shooter has been shot and killed. He's an Excel employee,” Walton said. “Authorities killed him."

EMS workers gather a staging area by Excel Industries in Hesston, Kansas, Thursday, Feb 25, 2016.—AP

“This is just a horrible incident that happened here,” he said.

“There's going to be a lot of sad people before this is all over."

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.

He also posted a video of himself firing an assault rifle in what appeared to be a wheat field.

Local media said Ford had an extensive criminal record, including a history of prowling, loitering and illegal weapons possession.

Witnesses reported seeing the gunman first shoot a woman in the parking lot of the factory before entering the assembly area and opening fire.

Walton, meanwhile, said at least two of the victims were shot by the gunman from his car as he drove to the factory. He said one was shot in the shoulder and one in the leg.

'Wake up'

“He was traveling and shooting from his car,” the sheriff told local TV.

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

He said the gunman was shot by police who rushed to the scene.

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.

Another man who was inside the plant when the tragedy unfolded said people ran for their lives screaming “fire, fire” as the gunman sprayed the assembly area with an AK-47 and a 9mm gun.

“I hear about these shootings at theatres and things, and it's just a mess... it's horrible,” he 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 reportedly told the media they believed that the shooter had emotional and mental problems.

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 2 massacre in San Bernardino, California that left 14 people dead, and the December 14, 2012 Sandy Hook school massacre that killed 26, including 20 children.

Gun violence claims the lives of about 30,000 Americans every year and mass shootings — rare in most countries — have been on the rise.

In a grim irony, Walton said his department had held a meeting last week on how to deal with an active shooting situation.

“Any place that thinks it can't happen here, wake up,” he said. “Because it can happen."