The shooting was reported in the area of 65th Street and Broadway at about 5:45 p.m., police said. The shootings appeared to have occurred from a distance and the officers did not appear to be targeted, investigators said.
The officers, who were in plain clothes and in an unmarked vehicle at the time of the shooting, were grazed by gunfire and treated at the scene for minor injuries.
Investigators say the narcotics officers returned fire, but it was unclear if the suspects were hit.
At least one person was detained for questioning in connection to the shooting, but police believe two male suspects remain at large.
Dozens of SWAT deputies and police dogs participated in the search.
A large perimeter was set up from Gage Avenue to 67th Street and Broadway to Main Street.
"We are asking the public to shelter in place and to call 911 if there is any unusual activity in their yards or in their neighborhood," said Los Angeles police Det. Meghan Aguilar.
Community activist Najee Ali called for an end to violence.
"Anytime we shoot a police officer and protest them that way with violence, we're no better than the police officers," Ali said.
Anyone with further information was urged to call 911.