A 17-year-old girl was hit by a stray bullet Monday morning while walking to Central High School in Philadelphia's Logan section, police said.

Police Commissioner Richard Ross said the high school junior was walking on the 1600 block of West Olney Avenue, a block from Central, when gunfire erupted from 16th Street.

Struck in the shoulder by a bullet, the girl ran to her school and went to the nurse's office, where the slug fell out while she was being treated, Ross said.

"There is no question she was not the intended target," Ross said.

The girl, whose name was not released, was taken to Einstein Medical Center, where she was in stable condition, police said. The School District confirmed the girl was a Central junior but didn't identify her further; police don't typically release the names of victims of nonfatal shootings.

The shooting prompted an hour-long lockdown at Central as well as nearby Girls High School and Widener Memorial School.

Ross said the gunfire came from two males who were shooting at each other or a third person in what he called another case of "idiotic behavior" on the city's streets.

Ross said police would temporarily increase patrols in the area as investigators look for witnesses and surveillance video in an effort to identify the shooters.

Ross said that while the girl would be OK, the student, her family, and her schoolmates still experienced a significant trauma.

"We know the psychological impact of getting shot," the commissioner said.