Officers said 17 people were also wounded in the attack at a social service centre in San Bernardino.
The gunmen, wearing military-style clothing and armed with long guns, opened fire at the Inland Regional Center, which helps adults with disabilities.
Witnesses said people locked themselves in offices as the gunfire rang out.
Hours after the attack, police hunting for the attackers riddled a black SUV with gunfire in a residential area several miles away.
San Bernardino Police Chief Jarrod Burguan tweeted: "Suspects are down, one officer wounded. Details still unfolding."
It is unclear if there is still a third suspect on the loose, but he warned residents in the area to stay inside.
The attack took place in a conference area where the San Bernardino County Department of Public Health was holding a social event, said Maybeth Field, the centre's president.
FBI officials said they do not yet know if it was a terrorist attack but local police said it might have been domestic terrorism.