Deputies shot and killed a man who was armed with a fake gun, while they were serving an eviction notice Friday, the San Diego County Sheriff's Department (SDSO) confirmed.

San Diego police received a call at 7:53 a.m. from a home on Second Avenue between Hawthorne and Grape streets.

Deputies were serving an eviction notice moments before the shooting, according to SDSO Lt. Glisson.

San Diego Police Homicide Unit Lt. Mike Holden described the events that led up to the shooting.

"As they knocked on the door, the occupant who was the target of the eviction told them that if they entered he would arm himself with a handgun," Holden said.

Once the deputies entered the apartment's living room, the man ran into his bedroom and returned with what appeared to be a semi-automatic handgun. As he pointed the weapon at them, both deputies fired several rounds at the suspect, Holden said.

After he was shot, the man retreated back into his bedroom, Holden said. They followed him there and found the suspect with several gunshot wounds.

The suspect, identified as a 47-year-old man, was transported to Scripps Mercy Hospital, where he was pronounced dead, Holden said.

Neither deputy was injured in this incident.

The man was the only person in the apartment at the time, Holden said. He said the man was supposed to be removed from the unit.

"I can't speak to what protocols would apply to this," Holden said. "We're here to investigate an officer-involved shooting."

San Diego police will conduct the homicide investigation.

While searching the apartment, homicide investigators found a semi-automatic handgun replica inside the suspect's bedroom, according to the SDPD. The weapon appears to be either a BB air pistol or an Airsoft pistol.

The deputies involved in the shooting included a 17-year veteran and a 9-year veteran of the SDSO, according to police.

Anyone with information related to this incident can call the SDPD Homicide Unit at (619)531-2293 or Crime Stoppers at (888)580-8477.