(Reuters) - The man suspected of killing three people at the Kansas lawnmower factory where he worked was served 90 minutes before his shooting spree with a court order to stay away from a woman who said he had abused her, authorities said on Friday.

The suspect, identified as Cedric Ford, 38, was armed with a .223-caliber assault-style rifle and a pistol as he fired randomly at coworkers and others over about 30 minutes on Thursday. Fourteen people were wounded.

The first police officer to reach the scene, Hesston Police Chief Doug Schroeder, killed Ford in an exchange of gunfire, said police secretary Jeannine Hoheisel. Hesston is a town of about 4,000 people about 36 miles (60 km) north of Wichita.

“The man was not going to stop shooting,” Harvey County Sheriff T. Walton said on Friday, noting that there were up to 300 people in the Excel Industries factory where the worst of the rampage took place. “The only reason he stopped shooting is because that officer stopped the shooter.”

Ford had been served a protection from abuse court order earlier Thursday at the factory, which may have triggered the bloodshed, though no motive has been determined, authorities said. He left the factory after being served but began shooting about 90 minutes later.

The order, posted by the Wichita Eagle on its website, was sought by an unidentified woman who had been living with Ford and said he had been physically abusive. She wrote in the order that he was alcoholic, violent, depressed and in need of medical and psychological help.

Police identified the victims as Renee Benjamin, 30; Joshua Higbee, 31; and Brian Sadowsky, 44 - all Excel employees, according to the Harvey County Sheriff’s Office.

Cedric Ford, suspect in the Kansas shooting. REUTERS/Harvey County Sheriff's Office

The 14 wounded victims were at hospitals in fair to critical condition.

Ford had a history of domestic violence, including arrests in 2008 and 2010, the sheriff’s office said.

The shooting began with Ford firing out of his vehicle and wounding two people as he drove through two cities back to the factory, authorities said. He stole one victim’s car, went to Excel Industries and shot someone in the parking lot before going inside.

A 28-year-old woman from Newton was charged on Friday with illegally transferring two guns to Ford, said U.S. Attorney Barry Grissom of Kansas in a statement. She had previously had a relationship with Ford and had lived with him, according to the affidavit.

Sarah Hopkins faces 10 years in prison if convicted of giving the assault-style rifle and Glock .40-caliber handgun to Ford while knowing he was a convicted felon who was prohibited from possessing firearms, according to the statement.

A lawyer for Hopkins could not be immediately identified.

The attack follows a mass shooting in Michigan last weekend, when a driver for car-hailing service Uber was charged with killing six people.

President Barack Obama, at an event in Jacksonville, Florida, expressed exasperation with the U.S. Congress’ failure to act on gun violence issues.

“The real tragedy is the degree to which this has become routine,” he said.

The number of mass shootings in the United States has elevated gun control as an issue in the November U.S. presidential election.