Supervising officers were sent to make a felony arrest shortly after 1 a.m., but he struggled with them when they arrived, first putting up a physical fight, then firing his gun but hitting no one, Macagni said.

Several officers came to help the police making the arrest, and one of them shot the suspect in the chest once, Macagni said. He was declared dead after emergency surgery, Macagni said in a statement.

Detectives had begun investigating the alleged relationship on Thursday night, and minutes before the shooting had confirmed that an "inappropriate" and "very explicit" relationship had been going on, Macagni said.

He said he could not give details because of the sensitivity of the investigation, but "there was some witness intimidation involved" and the arrest couldn't wait.

"The information that we had in hand demanded that we not let him leave that scene, get in a car, drive somewhere, it would put the public at risk," Macagni said.

The officer who fired the fatal shot, who has eight years on the force, has been placed on administrative leave, and the Santa Barbara County Sheriff's Department is investigating the shooting, Macagni said.