Media playback is unsupported on your device Media caption Witnesses spoke of panic at the factory, James Cook reports

A gunman has killed three people and wounded 14 more before being shot dead in the US state of Kansas, police say.

Ten people were left critically injured at a lawnmower factory in Hesston on Thursday, where the attacker worked.

Police say the gunman, Cedric Ford, had been served a court order hours before, which may have been the trigger.

The attack comes less than a week after a man was charged with killing six people and wounding two others during a shooting rampage in Michigan.

A number of mass shootings in the United States have elevated gun control as a campaign issue in this year's presidential election.

'Random' Michigan shootings kill six

Obama considers unilateral action on gun violence

Image copyright AP Image caption Police exchanged fire with the gunman, who was later shot dead

Local police say the gunman, identified as 38-year-old Cedric Ford, began shooting at around 17:00 local time in the town of Newton.

Harvey county's Sheriff T Walton said the attack happened hours after the suspect was served a "protection from abuse" order - a civil court order telling a person not to have contact with someone - suggesting it could be a possible motive.

"I believe that probably is the trigger, and it went from there," Sheriff Walton told reporters on Friday.

He had a history of convictions for previous offenses, including burglary, theft and fleeing a police officer, according to public records.

'He looked right at me'

The gunman shot a truck driver in the shoulder, and another man in the leg as he drove towards the Excel Industries site where he worked.

He then opened fire in the car park, killing one person, before killing two more people inside the factory site.

Factory employee Martin Espinoza described how the gunman, a colleague who he said usually had a calm demeanour, attempted to shoot him.

The gunman pointed his weapon at Mr Espinoza and pulled the trigger, but the weapon was empty. Mr Espinoza then ran away as the gunman took out a second gun.

Image copyright AP Image caption The gunman was an employee at the Excel Industries lawnmower firm in Hesston

"I looked right at him and he looked right at me," Mr Espinoza said.

Another witness described scenes of panic.

"All I know is I'm seeing people running and so I'm assuming fire, and so I take a few steps and I hear pop, pop and I'm thinking just some paint cans or something going up, and more people running and all of a sudden, pop, pop, pop, pop, pop, pop, pop, pop, pop and I'm going, ahh, I start running too," said one man.