The officer was in his car on a street behind El Camino Real High School in Woodland Hills shortly after 11:30 a.m. Wednesday when he was hit, according to a Los Angeles Unified School District spokeswoman.
"He was shot in his vest. He wears a bulletproof vest so the bullet did not penetrate," district spokeswoman Susan Cox said. The officer was taken to a hospital and was reported to be conscious and breathing, Cox said.
Dozens of city police cars sealed off the area and the school itself was locked down after the shooting as officers hunted for a suspect described as a man in his 40s with a black jacket and long hair.
"We have detained a number of people, questioning them, but nobody has been arrested or is in custody," city police Officer Sara Faden said.
The shooting occurred a day after two 15-year-old students at Gardena High School were wounded when a gun hidden in a student's backpack accidentally discharged. That student and two others were arrested.
No students were believed to be involved in Wednesday's shooting but students and staff were confined inside the nearby school under a "campus protection" policy used when there is police activity nearby, school officials said.
"There is no jeopardy to any student," incoming district superintendent John Deasy told KABC-TV.
A message posted on the school's website requested that parents not come to campus to pick up their children.
"The incident happened off-campus and the lock-down mode is a standard precaution to secure the campus. All the students are fine and safe," the statement said.