The Los Angeles Police Department says the officer was driving on Crenshaw Boulevard near Hyde Park Boulevard around 6:30 p.m. Thursday when they saw two men in a fight.
Police say the suspect had a handgun and fired at least one shot.
The officer stopped, got out of their car, and shot the suspect, who was pronounced dead at the scene, according to LAPD.
Police say the officer and the person being robbed were not injured.
The shooting is under investigation.