The detectives were waiting to get into the station at 4861 W. Venice Blvd. between 4 a.m. and 4:30 a.m. when a gunman lying in wait opened fire, according to law enforcement sources.
Both officers were hurt, but their injuries did not appear to be life-threatening, the sources said.
A motive for the attack was unclear and a manhunt was underway.
A description of the suspected shooter was not immediately available.
Intersections were shut down for several blocks around the immediate area.