Law enforcement officials struggled Friday to understand how this small town had become the latest American community to be shaken by a mass shooting as they pieced together why an attacker had gunned down three people and injured 14 others before being killed by police.

In some ways, the violence Thursday was familiar: a lone gunman described as troubled targeting a place he knew.

Cedric Larry Ford, 38, had randomly sprayed bullets at the lawn-mower factory where he worked, authorities said. Clues emerged about a possible motive: Ford was described as depressed and had been served with a restraining order just before the attack, which police said probably led to the bloodshed.

Yet the rampage, which started on a rural highway, did not fit a general pattern of previous mass shootings in the nation’s endless series of such tragedies.

For one, Ford was African American — research shows that the vast majority of mass public shootings are committed by whites. And unlike most mass shooters, Ford had an extensive criminal record, which may have precluded him from obtaining his weapons legally.

Cedric Ford, 38, went on a shooting rampage in Hesston, Kan., killing three people and injuring 14 on Feb. 25. Here's what we know about him. (Monica Akhtar/The Washington Post)

Even his weaponry deviated somewhat from the norm; handguns are most frequently used in mass shootings. While police said Ford was armed with a semiautomatic pistol, he also carried an ­assault-style rifle.

Yet the grieving of this blue-collar community 35 miles north of Wichita has become all-too recognizable.

Authorities vowed a thorough investigation and identified the three people who died inside Excel Industries: Renee Benjamin, 30; Joshua Higbee, 31; and Brian Sadowsky, 44. Some of those injured remained in critical condition, authorities said.

“I’ve never seen anything like this,” Harvey County Sheriff T. Walton said in a morning news conference. He said the gunman had not aimed at any specific co-workers at Excel. “He was randomly shooting people.”

The sheriff added: “As far as ‘We don’t think it’s ever going to happen here,’ isn’t that what every sheriff says who’s stuck up on the podium like I am? But it does, and it’s happened here. I wish I wasn’t the sheriff in front of these cameras, but it has happened here.”

Walton and other officials left an afternoon news conference without taking questions or offering much new information.

The shooting rampage came just five days after a gunman in Kalamazoo, Mich., killed six people, also apparently at random. Hesston joined the ranks of U.S. communities that have suffered mass shootings, a list that just in the past year has grown to include San Bernardino, Calif.; Roseburg, Ore.; and Charleston, S.C.

50 years of U.S. mass shootings: The victims, sites, killers and weapons

Witnesses at the Excel plant, where Ford worked as a painter, described scenes of pandemonium, with Ford killing three people before a Hesston police officer fatally shot him in an exchange of gunfire near the front offices.

Local officials declined to name the officer, but Kansas Gov. Sam Brownback (R) identified him as Hesston Police Chief Doug Schroeder.

Schroder was first on the scene and didn’t wait for backup before entering the Excel building, the governor said. “He went right in and did a heroic duty and service,” Brownback said.

The episode unfolded after sheriff’s deputies served Ford at 3:30 p.m. Thursday with what Walton described as a “protection from abuse” order. He declined to be more specific. Police Sgt. Chris Carter said he had earlier served Ford with a temporary protective order at the Excel plant on Feb. 5. Ford’s girlfriend had sought such an order that same day, Kansas news media have reported.

About 4:30 p.m., police said, Ford failed to return to work after a break. Then just before 5 p.m. came reports of the initial gunfire: shots fired from a vehicle near 12th Street and Meridian Road on the northwest side of Newton, where a male victim was shot in the shoulder. Minutes later, came word of another shooting at Meridian and Hesston roads, where a victim had been shot in the leg, police said.

Police said Ford then drove about five miles northwest to Excel, where he shot and wounded a person in the parking lot before entering the building.

The other workers at Excel were in the middle of a routine factory shift, employees recalled.

Michael Dellinger, 20, said he and his co-workers had just gotten out of a safety meeting when he heard an unfamiliar popping noise. Dellinger works on an assembly line in the plant’s large, open main room and is accustomed to loud sounds, so he said he didn’t think anything of it. But then he said he saw Ford standing in the open doorway to the parking lot, holding a gun. Ford started firing at the paint line, Dellinger said, and then at the assembly line next to Dellinger’s.

“Then he turned toward our line,” Dellinger recalled in a telephone interview. “I grabbed the guy next to me and said, ‘Run, there’s a gun.’ ”

When John Burnett, another assembly-line worker, saw people running toward the plant’s back door, he sprinted after them. As he ran toward the exit, he stopped to help an wounded co-worker who was clutching his back in pain.

“I could tell there was blood,” Burnett said in a phone interview. “He was a painter, so he was wearing a paint suit, and they are white, and I noticed there was red all over his paint suit.” Burnett helped the man outside, where others tried to stop the bleeding and called 911.

On Friday afternoon, federal authorities answered one of the out­standing questions: How did a man with an extensive criminal record get the guns used in the shooting? They filed a criminal charge against Sarah T. Hopkins, 28, of Newton, alleging that she transferred the guns to Ford last year despite knowing that he was a convicted felon.

She bought the Glock semi­automatic handgun and the Zastava Serbia, an AK-47-type semi­automatic rifle that Ford had when he was killed, an agent with the Bureau of Alcohol, Tobacco, Firearms and Explosives said in an affidavit filed in U.S. District Court for the District of Kansas.

Hopkins told law enforcement officers after the shooting that she and Ford had been in a relationship and lived together in Newton before she moved out in July, the affidavit said. She told authorities that she went to the home the following month with police officers to get the guns but that she returned them to Ford after he threatened her.

Hopkins could not be reached for comment Friday.

According to public records, Ford has an extensive criminal history, including charges for burglary, fleeing police officers, grand theft and an unspecified felony. Most of the incidents occurred in Broward County, Fla., and date to 1996.

A 1997 Miami Herald story said Ford was arrested that year after he was seen breaking into a car with two accomplices. In 2008, he was convicted in a misdemeanor brawling case in Kansas, the Wichita Eagle reported.

Earlier this month, Ford was accused of assault by his girlfriend. It was not immediately clear whether this woman was Hopkins. “He placed me in a chokehold from behind,” the girlfriend wrote in a request for a protective order filed Feb. 5, according to the Eagle. “I couldn’t breathe.”

She added, in all capital letters: “He is an alcoholic, violent, depressed. It’s my belief he is in desperate need of medical & psychological help!”

Most recently, Ford lived alone in a mobile home in Newton, about eight miles from Excel. It was unclear when he left Florida and arrived in Kansas.

On Friday, windows in the mobile home were shattered, and the doors were broken in. Neighbors were sweeping up debris.

A looter came about 3 a.m. Friday, said Dylan Jave, 24, who lives across the street. Jave said that he called police and that they arrested the man.

Jave and his cousin Anthony Williams, 21 — who also lives across the street — described Ford as a quiet man who didn’t socialize with neighbors. They said Ford had just bought a new black Dodge truck. “I said, ‘Nice truck,’ ” Williams said, “and he just stared at me. Didn’t say a word.”

Ernie Carson, the property manager, said that when Ford filled out a rental application, he was asked about his criminal history and “admitted that he had done wrong, but that was all back in Florida and he came up here to turn his life around.”

“Everybody makes mistakes,” Carson said, “but you can’t expect something like this.”

Ford’s Facebook page expressed his interest in hip-hop, restaurants and cars — and, in recent months, guns. A photo from January shows him sitting in the front seat of a car with a handgun on his lap and what looks like a bottle of vodka between his legs. In a video posted in September, he is seen shooting a semiautomatic rifle into an empty field.

Among the pages he “liked” were “Love My Glock,” “AK-47″ and “Magpacker,” a gun shop in Texas.

Several Excel workers said Ford had been worried recently that he would be fired, although it was unclear why.

Dellinger said he felt that there was something “real off” about Ford from the start, although he said he could never pinpoint what it was.

Berman and Markon reported from Washington. Jacob Bogage in Newton, Kan.; Zachary Fagenson in Miami Gardens, Fla.; Francisco Alvarado in Homestead, Fla.; and Adam Goldman, Sari Horwitz, Michael Miller, Sarah Kaplan, Yanan Wang, Justin Wm. Moyer, Julie Tate, Michael S. Rosenwald and Magda Jean-Louis in Washington contributed to this report.