The shooter, 38-year-old Cedric Ford, was killed by law enforcement officials, according to authorities.
Four people are dead and 14 others have been injured after an employee opened fire Thursday at a Kansas industrial firm.
The shooter, 38-year-old Cedric Ford, was killed by law enforcement officials at Excel Industries in south-central Kansas, said Harvey County Sheriff T. Walton.
Read: How to Use a Belt to Barricade a Door During a Shooting
Employees and witnesses identified the gunman as a painter at the plant who seemed normal when he turned up for work on Thursday.
But Ford became upset after being served at work with a restraining order, and left the premises, authorities said Friday. His shooting rampage started about 90 minutes later, according to Walton.
Ford was armed with a .223-caliber assault rifle and a handgun. He randomly fired at coworkers for about 30 minutes before being shot dead by the first police officer to reach the factory, according to authorities.
"The man was not going to stop shooting," Walton said at a Friday news conference. There were about 300 employees at the plant, he said.
"The only reason he stopped shooting is because that officer stopped the shooter."
Ford had been served with a protection order from an unidentifed woman who claimed domestic abuse and said Ford needed medical and psychological assistance, according to local reports.
Police identified the three dead victims as Renee Benjamin, 30, Josh Higbee, 31, and Brian Sadowsky, 40, CBS affiliate KWCH-TV reported.
Ford fired from his car as he drove back to work, then stole a vehicle before pulling into Excel's parking lot, where he shot someone before going inside.
A fellow employee told the station he saw the Ford leave a truck before yelling something and opening fire.
"Within seconds after he fired...he was right into the building within five seconds," the employee said.
An incredibly emotional moment of a husband and wife reuniting after the shooting LIVE on air. #kwch12 #Hesston pic.twitter.com/4qvwDKhAQn
— Will Kunkel (@KWCHWill) February 26, 2016
Fellow workers described Ford as a quiet man who kept to himself and appeared to be "a nice guy."
He had recently moved to the area from Florida, neighbors said. According to KWCH, he had a criminal record in Florida that included convictions for burglary, grand theft, and prowling.
His Facebook page shows several photos of him with weapons, as well as images of him with young children.
Watch: Judge Denies Bail to Uber Driver Who Allegedly Killed Six in Shooting Spree