SAN BERNARDINO, CALIF. — At least two gun-wielding ­assailants opened fire on a holiday party for county employees Wednesday, killing 14 people in the deadliest mass shooting in the United States since the Sandy Hook Elementary School massacre three years ago this month.

Hours after the shooting, law enforcement officials said two suspects — Syed Rizwan Farook, 28, and Tashfeen Malik, 27 — had been killed in a police shootout several miles from the site of the original attack.

In between were four hours of terror that brought the city of San Bernardino to a standstill. Fearful residents sheltered in homes, emergency responders rushed to get bleeding victims to safety, and dozens of law enforcement officers were embroiled in a car chase that took them from a residential street in nearby Redlands to a shootout back in San Bernardino that left both suspects dead, an officer wounded and one more community permanently changed.

The motives behind the mass shooting — the 355th in the U.S. this year — are still unclear. At a late-night news conference, San Bernardino Police Chief Jarrod Burguan said that Farook is a U.S. citizen who worked as a health inspector for the San Bernardino County Department of Public Health, which was hosting Wednesday’s holiday party.

Police did not know where Malik was born or where she lived. A third suspect who had been seen fleeing the shootout was also taken into custody, though it was not clear whether he had been associated with the attack.

Asked about the third suspect, Burguan replied, “Right now, as we continue to drill down our information, it looks like we have two shooters. We are comfortable that the two shooters that went into the building are the two shooters that are deceased.”

Farook was at the gathering Wednesday, Burguan said, but he left early “under circumstances described as angry or something of that nature.”

Shortly after, Farook apparently returned with Malik, who officials believe is either his wife or fiancee. Then he allegedly opened fire.

Burguan declined to comment on what may have precipitated the attack. But, he said, the couple seemed too well-prepared for the shooting to have been set off solely by something that happened earlier that day.

“Based upon what we have seen and how they were equipped, there had to be some degree of planning that went into this,” Burguan said. “I don’t think they grabbed the guns and tactical gear on a spur-of-the-moment thing.”

He and other law enforcement officials said that terrorism has not been ruled out.

“One of the big questions that will come up repeatedly is: ‘Is this terrorism?’ ” said David Bow­dich, assistant director in charge of the FBI’s Los Angeles office, said at an earlier news conference. “It is a possibility. We are making some adjustments to our investigation. It is a possibility. But we don’t know that yet. And we are not willing to go down that road yet.”

A senior U.S. law enforcement official told The Washington Post that Farook had not been under FBI investigation.

The mass shooting Wednesday erupted at the Inland Regional Center, a three-building complex that houses a conference center and a facility that serves people with developmental disabilities. Dressed in black masks and tactical gear and carrying multiple weapons, the assailants barged into an auditorium where an annual gathering of health department employees was underway.

The barrage of gunfire set off a tense, confusing and terrifying day in Southern California as the shooters — their number unclear, their identities unknown, their motives unimaginable — fled the center in a black SUV and eluded capture for hours.

Police followed a tip that led them to a house in the nearby city of Redlands. During a stakeout there, they spotted an SUV that matched the description of the suspects’ vehicle, and when the occupants drove away, police gave chase. A law enforcement source said the suspects threw objects — possibly pipe bombs — out the window.

The suspects drove back into San Bernardino and, reaching a residential neighborhood, stopped and began exchanging gunfire with more than 20 officers. One officer was injured in the firefight, but police said the wounds were not life-threatening. The two suspects were killed, their vehicle riddled with bullets.

The immediate aftermath was captured by helicopter news crews, who provided a live feed to a national audience watching on television and online. Police officers swarmed the neighborhood, guns drawn, taking cover behind walls and armored SWAT vehicles. Three armored vehicles surrounded the SUV, and officers slowly and methodically determined that no one inside had survived the hail of gunfire.

The two slain suspects were armed with assault rifles and handguns, Burguan said. Three explosive devices were also recovered from the shooting scene.

The Bureau of Alcohol, Tobacco, Firearms and Explosives said Wednesday night it had recovered two rifles and two handguns and is conducting “urgent traces” to determine where the weapons were bought.

Later, ATF spokeswoman Meredith Davis told the Los Angeles Times that said officials had “successfully traced” the four guns recovered in connection with the San Bernardino shooting and determined that two of the weapons were purchased legally. The origins of the two other weapons are still being investigated.

The two legally purchased guns were bought by an individual associated with the investigation, Davis said, but she declined to name the person.

Recent mass shootings in the United States have typically involved a lone gunman, often someone mentally unstable or consumed with rage. Multiple-shooter events are extremely rare: According to a recent FBI report on 160 “active shooter incidents” between 2000 and 2013, all but two involved a single shooter.

Witnesses reported seeing shooters in black clothing using long guns akin to assault weapons.

“They came prepared to do what they did as if they were on a mission,” Burguan said. “They were dressed and equipped in a way that indicate they were prepared.”

That level of preparation is under scrutiny as law enforcement probe for a possible motive in the shooting.

Details about suspected shooters are hard to come by. According to the Los Angeles Times, Farook was born in Illinois, and his parents had immigrated to the U.S. from Southeast Asia. He had worked for the county health department for five years, officials said, and he attended the annual holiday party the year before.

Doyle Miller, who owns the house in Redlands on which police converged Wednesday, said that Farook and Malik moved in five or six months ago. They lived there with their young child and a “grandmother,” he told USA Today, and rarely posed any problems.

“The only thing we complained about is that he didn’t take care of the backyard,” Miller said.

Speaking on behalf of the family, the executive director of the Council on American-Islamic Relations’s Los Angeles office Hussam Ayloush said that Farook and Malik were married.

On Wednesday morning, the couple left their infant daughter with Farook’s mother, telling her that they were headed out for a doctor’s appointment.

By evening, the couple was dead, killed in a standoff with law enforcement, and it was clear that their story about the doctor’s appointment had been a ruse.

The two left behind little in the way of a paper trail — no apparent criminal record, no Facebook pages or Twitter accounts.

An online dating profile for a “farooksyed49” from Riverside, Calif. resembles the suspect described by law enforcement. The profile, on the “Indian matrimonial and dating service”, describes a 22-year-old man from a “religious but modern family.”

“I work for county as health, safety and environmental inspector,” it reads. “Enjoy working on vintage and modern cars, read religious books, enjoy eating out sometimes travel and just hang out in back yard doing target practice with younger sister and friends.”

The man in the profile picture is tall and bearded, posed jauntily in front of a nondescript building flanked by palm trees and a smooth, green lawn. He writes that he is interested in “matrimonial.”

Speaking to the Los Angeles Times, coworkers who knew Farook described him as a quiet and polite man who held no obvious grudges against people in the office. They said he recently traveled to Saudi Arabia and returned with a woman he met online.

The officer had recently held a shower for the couple’s new baby, and two seemed to be “living the American dream,” said Patrick Baccari, a fellow inspector who shared a cubicle with Farook.

Griselda Reisinger, who worked with Farook before leaving the agency in May, and other colleagues told the Los Angeles Times that Farook was a devout Muslim, but not vocal about his religion

“He never struck me as a fanatic, he never struck me as suspicious,” Reisinger said.

Even before law enforcement named the two suspects, CAIR held a press conference in response to the name that was being circulated in media reports — apparently to preempt potential backlash to news about the assailants’ religion.

“The main intention was to strongly condemn what had happened, Ojaala Ahmad, the organization’s communication’s director, said in a phone call after the press conference. 

“If it ends up the suspect was Muslim, people are going to — there will be that whole wave of Islamophobia,” she said. “We wanted to say that we grieve as Americans.”

Farhan Khan, who was introduced as a brother-in-law of the suspect, said he had no clue what might have driven his relative to such a crime.

“Why would he do that. Why would he do something like that?” Khan said, his expression weary, his eyes red. “I have no idea. I’m in shock myself.”

Khan said he spoke to his brother-in-law a week ago, but would not answer other questions or give the man’s name. He would not comment on whether his brother-in-law is a religious person.

“I cannot express how sad I am today,” he said.

When the family heard that a shooting had taken place at party for Farook’s office, they feared that he had been hurt, CAIR-LA’s executive director Hussam Ayloush said. They never imagined that their relative might have been the gunman.

In addition to the 14 dead, at least 17 people were being treated in local hospitals for injuries suffered in the rampage. A spokeswoman for Loma Linda University Medical Center said Wednesday that two of the five patients treated there were in critical condition.

“We don’t know who the gunmen are, or why this happened. It’s devastating,” said Marybeth Feild, president of the Inland Regional Center’s board of directors, who was not in the building at the time of the shooting. “I just don’t know how we’re going to recover from this. It’s just overwhelming. Why would anyone target a social service center?”

The Inland Regional Center is a three-building complex that houses a conference center and serves more than 30,000 people with developmental disabilities. Nearly 700 staff members work there, according to the organization’s Facebook page, promoting “independence, inclusion, and empowerment.” The organization says that it is committed to eliminating barriers for individuals with developmental disabilities so that they can “live a typical lifestyle.”

The center held its own holiday party Tuesday, and a brief video clip showed staffers and clients in wheelchairs dancing to the 1980 mega-hit “Celebration” by Kool & the Gang.

On Wednesday, the city’s public health department had rented out the conference center’s first-floor banquet room for a holiday party, complete with Christmas trees and other decorations. The event was in full swing when the first reports of gunfire came, at 10:59 a.m.

Initially, when the gunshots went off, few people registered them as such.

Dorothy Vong thought it was a drill. The nurse told the Los Angeles Times that drills are common at the Inland Regional Center, where patients and clients occasionally erupt into anger.

She texted her husband, “Drill started,” then began filming the scene outside. Police officers were pouring out of vehicles in the sun-lit parking lot and racing toward the building.

“Look, they’re all there!” a woman in the background said, her tone bright. She didn’t realize what’s happening. “This is scary, they’re all geared up.”

Someone else said, “They’re coming onto here,” but a quaver of concern had crept in. The reality of their situation was dawning on them. The video switched off.

Moments later, Vong texted her husband: “Well, it’s real.” She waited out the massacre in a locked office.

Chris Nwadike, an employee of the public health department, said he heard something like explosives while he was on a bathroom break from a meeting.

“Big sounds first, then a few seconds, then we heard the gunshots,” he recalled. Someone in the bathroom said, “Everybody lie down,” so he did. After about 10 minutes, the police came and directed everyone out of the building.

For Melinda Rivas, a social worker who works at the center, realization struck when a woman down the hall shouted, “There’s a shooting!” Rivas and co-workers barricaded themselves in a conference room.

She called her two adult children: “There’s a shooting going on. Be safe,” she told them. Finally, a SWAT team evacuated those hiding, telling them to keep their hands raised as they walked out of the building. Rivas texted her children, with relief this time: “I’m safe.”

“This is one of those things I’ve often seen on the news, and now I was a part of it,” Rivas said later in the day. She recalled leaving the building to the sight of people in panic, yelling and screaming, with clothing and emergency equipment strewn about.

“It was almost like a bloody warpath,” she said. “… This is one of those things I’ve often seen on the news, and now I was a part of it.”

The shooting shut down much of Southern California’s “Inland Empire,” which stretches into the desert east of Los Angeles. Schools and county buildings were put on lockdown for fear that gunmen were on the loose and prepared to attack again. The Federal Aviation Administration imposed temporary flight restrictions over the city at the request of local law enforcement. Police went to stores and restaurants miles from the scene of the shooting and warned people to stay inside.

“It’s scary. We’re supposed to be evacuating,” said Kim Scott, a cashier at a 99 Cents store in the Waterman Discount Mall a few miles away. “I’m behind Register 3. We’re hiding out until they tell us to get out. … I want to go home. I don’t know what’s going on.

Meanwhile, SWAT team members went room by room through the three buildings in the IRC complex. Numerous victims were seen in television footage being carried away on stretchers. Medical teams set up a triage area on a nearby public golf course.

By mid-afternoon, police were bringing relatives of victims to the Rudy C. Hernandez Community Center. At least 100 family members could be seen sitting in the bleachers at the community center, where authorities assembled clergy and grief counselors.

“I’m worried, petrified, scared,” said Sherry Esquerra, whose daughter and son-in-law, Shawna and Daniel Timmons, work at the IRC. She said she’d left phone messages but hadn’t heard back.

“She would text me. I know she would know that I am worried,” Esquerra said. “They do social work. I don’t know how anyone could do this to them.”

Nearby, pastor Wiley S. Drake comforted a woman whose co-worker had been killed.

The co-worker had said, “I hear firecrackers,” the distraught woman recalled to Drake as she sat beside her husband on the community center’s bleachers.

The woman looked up, and suddenly the other woman was on the floor. Her co-worker had been shot dead before her eyes.

After nightfall, an impromptu vigil coalesced at the scene of Wednesday’s bloodbath. People clutching candles in paper holders formed a tight circle, heads bowed in prayer.

The San Bernardino massacre follows a series of mass shootings just in the past six months. They include attacks on a black church in Charleston, S.C.; at a military recruitment center in Chattanooga, Tenn.; in a movie theater in Lafayette, La.; at a community college in Oregon; and just last week at a Planned Parenthood facility in Colorado Springs.

One Internet site that tracks mass shootings — defined as events in which four or more people are killed or injured — reported that San Bernardino’s tragedy was the 355th such shooting this year, a pace of more than one a day. Earlier on Wednesday, a gunman in Savannah, Ga. shot four people, killing a woman and injuring three men.

“Obviously our hearts go out to the victims and the families,” President Obama said in a television interview. “The one thing we do know is we have a pattern now of mass shootings in the country that has no parallel anywhere else in the world.”

Obama called for “common sense” gun-safety laws. And he noted that while people are fearful of a terrorist attack, under current law, people on the U.S. no-fly list can still legally buy a gun.

“Those same people who we don’t allow to fly could go into a store right now in the United States and buy a firearm, and there’s nothing that we can do to stop them,” Obama said.

Earlier in the day, even before the shooting, doctors in white lab coats descended on Capitol Hill to ask Congress to lift a decades-old ban on research on gun violence.

Most of the presidential candidates took to Twitter to respond to the massacre, with Republicans and Democrats taking different tacks. The GOP contenders almost universally offered prayers for the victims.

“California shooting looks very bad. Good luck to law enforcement and God bless. This is when our police are so appreciated!” tweeted Republican front-runner Donald Trump.

The three major contenders in the Democratic race, meanwhile, specifically cited the need to stop gun violence.

“I refuse to accept this as normal,” tweeted Democratic front-runner Hillary Clinton. “We must take action to stop gun violence now.”

Dauber is a freelance writer. Kaplan and Achenbach reported from Washington. Freelance writer Martha Groves in San Bernardino and staff writers Mark Berman, Adam Goldman, Lindsey Bever, Niraj Chokshi, Ann Gerhart, Sari Horwitz, Elahe Izadi, Wesley Lowery, Kevin Sullivan, Julie Tate, Justin Wm. Moyer, Yanan Wang and Alice Crites in Washington contributed to this report.