The California Supreme Court ruled Thursday that police departments must in most cases divulge the names of officers involved in on-duty shootings.

In the 6-1 decision, the high court rejected blanket bans that cite unspecified safety threats to officers as a reason for withholding the names.. The court said exceptions could be made to keep the names of undercover officers private and in cases where credible threats exist.

The high court ruled after considering a public records act request by the Los Angeles Times that sought the names of two Long Beach police officers involved in the 2010 fatal shooting of a man holding a garden hose.

The names of the officers were later released in a report by county prosecutors that cleared the officers of any criminal wrongdoing. However, a federal jury later ordered the city to pay the victim's family $6.5 million after finding the officers' acted recklessly.

The police union had asked a court to block the release of the officers' names. The city of Long Beach and several law enforcement groups supported the union's legal challenge.

The Long Beach Police Department said it would comply with the high court ruling on Thursday. The police union said it was disappointed by the decision.

"In today's Internet age, we believe that releasing the name of an officer is tantamount to releasing the officer's home address and other personal information," said union president Stephen James.

"In a case such as this one, which concerns officer-involved shootings, the public's interest in the conduct of its peace officers is particularly great because such shootings often lead to severe injury or death," Kennard wrote.

Justice Ming Chin dissented, saying he would allow departments to institute blanket bans on the release of officers' names because home addresses and other personal information are easily obtained online.

"Because the lives of our officers and their families are at stake, I would not require a law enforcement agency to wait until there is a specific threat - or worse, an actual attack - before allowing it to withhold information that puts its officers and their families at risk," Chin wrote. "Absent a showing of some greater public need for the information, we should allow law enforcement agencies to protect the very officers who are out there every day protecting us."

It was unclear how many police departments in the state have bans on releasing officers' names.

In Northern California, the Sonoma County Sheriff's Department initially declined in October to publicize the name of a deputy who fatally shot 13-year-old Andy Lopez after mistaking a pellet gun for an automatic rifle. A week later, the department identified the shooter after his name began circulating widely in the community.

The Sonoma County district attorney is still investigating that shooting.

The Los Angeles Police Department has a policy of releasing names of officers involved in shootings unless a specific threat is identified.