A man shot and killed in El Cajon on Thursday had attacked an off-duty security guard before the shooting, police said.

The unidentified man was killed around 9:30 a.m. at the 1300 block of East Main Street, near El Cajon Inn and Suites, El Cajon police Lt. Royal Bates said.

Investigators said Friday that witnesses saw the suspect try to violently attack an off-duty security guard.

The security guard told police that he then pepper-sprayed the suspect, but it had no effect.

When the security guard locked himself in his vehicle, the suspect tried to break two of his car windows, according to officials.

The guard managed to escape by driving away.

Investigators said it was then that the suspect redirected his attention and advanced towards the man who fired the gun and killed him.

No arrests have been made. They added that they do not believe the man who fired the gun and the man who was killed are acquaintances.

Vickie Bendixen, who claims to be the gunman's mother-in-law, said the man who was detained by police was defending his property.

When the man realized someone was stealing items from his car, he ran back to the motel room to grab his gun, she said.

“The guy was in the car taking things,” Bendixen said crying. “It’s come to the point where everybody has to take care of themselves. It’s a shame that it happened.”

The investigation is ongoing anyone with information can call the El Cajon Police Department at (619) 579-3311.