The incident occurred shortly before 2:30 p.m. in the 5200 block of Vesper Avenue, where Los Angeles police surrounded the building in the immediate aftermath of the shooting.
LAPD Chief Michel Moore says the gun battle happened when the off-duty officer left the apartment and went to a parking garage of the complex. The officer saw the suspect had broken into his vehicle and was wearing the officer's bulletproof vest and had stolen the officer's gun from his duty bag, which was stowed in the car, Moore said.
The officer, who was armed with a backup handgun, confronted the man about the break-in.
An altercation ensued, leading to the gun battle, Moore said.
The man fired at the officer, and the officer returned fire, Moore said. The shootout led to a breezeway behind the apartment, where the man was shot in an arm and shoulder and fell to the ground.
The officer retrieved the gun from the man and returned to his vehicle. He placed the weapons near the vehicle and collapsed with two gunshot wounds in his chest and one in his thigh, which he sustained during the shootout.
The officer was taken to a hospital, where he is in stable condition, Moore said. The officer, who underwent surgery, is "grateful to be alive but he is not out of the woods yet," the chief said. He is expected to survive his injuries.
LAFD personnel also discovered the suspect in the breezeway throwing the officer's handgun magazines over a fence.
The suspect was taken to a hospital in stable condition after he was shot three times. It was not immediately known how he gained access to the apartment's garage area or the officer's vehicle.
Moore didn't name the officer or the suspect but said the crime appeared to be random rather than targeted. Details of the shooting were still being investigated, including whether the officer had properly secured the weapon.
Neighbors who live in the area say the residential street doesn't get much traffic and kids play safely outside.
"It's very, very tragic. I don't think I will ever be the same living here to be honest," neighbor Assaf Assaraf said.
City News Service and the Associated Press contributed to this report.