The shooting was reported at 8:18 p.m. near the 405 Freeway onramp at Roscoe Boulevard in North Hills, a spokesperson for the Los Angeles Police Department said.
The officer and a companion came upon an altercation involving one man with a pipe and another with a handgun, the LAPD said. The suspect armed with the firearm was pronounced dead at the scene after being shot. He was not immediately identified.
Everyone involved in the incident remained at the location, authorities said, and the man with the pipe was taken into custody.
The Beverly Hills officer, whose name was not released, was cooperating with investigators but was not formally detained.